diff --git a/src/atlasViewer/atlasViewer.component.ts b/src/atlasViewer/atlasViewer.component.ts index 1fae2b1c3740c7b09dc7c4f600606b1ac81633c9..7d26de77b4a701fbed50b629f020787065eeed45 100644 --- a/src/atlasViewer/atlasViewer.component.ts +++ b/src/atlasViewer/atlasViewer.component.ts @@ -297,19 +297,23 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { } ngAfterViewInit() { - // Show modal for Agree cookies - if (!localStorage.getItem('cookies') || localStorage.getItem('cookies') !== 'agreed') { - setTimeout(() => { - this.modalService.show(ModalUnit, { - initialState: { - title: 'Cookie Disclaimer', - template: this.cookieAgreementComponent, - }, - // backdrop: 'static', - // keyboard: false - }); - }); + + /** + * Show Cookie disclaimer if not yet agreed + */ + if (localStorage.getItem('cookies') !== 'agreed') { + this.modalService.show(ModalUnit, { + initialState: { + title: 'Cookie Disclaimer', + template: this.cookieAgreementComponent, + } + }); } + + this.onhoverSegmentForFixed$ = this.rClContextualMenu.onShow.pipe( + withLatestFrom(this.onhoverSegment$), + map(([_flag, onhoverSegment]) => onhoverSegment) + ) } /** @@ -319,13 +323,6 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit { this.subscriptions.forEach(s => s.unsubscribe()) } - ngAfterViewInit(){ - this.onhoverSegmentForFixed$ = this.rClContextualMenu.onShow.pipe( - withLatestFrom(this.onhoverSegment$), - map(([_flag, onhoverSegment]) => onhoverSegment) - ) - } - /** * perhaps move this to constructor? */ diff --git a/src/ui/cookieAgreement/cookieAgreement.template.html b/src/ui/cookieAgreement/cookieAgreement.template.html index ff5f8c2c31b5a6760a7eacfa56dc4426d5e431e3..c064536b175036594d41cd1ca1284dbacee44f9c 100644 --- a/src/ui/cookieAgreement/cookieAgreement.template.html +++ b/src/ui/cookieAgreement/cookieAgreement.template.html @@ -12,7 +12,7 @@ <p class="cookie-text">To opt-out of being tracked by Google Analytics across all websites, visit <a href="http://tools.google.com/dlpage/gaoptout">http://tools.google.com/dlpage/gaoptout</a> .</p> - <button class="btn btn-outline-secondary show-more-button-on-cookie-agreement" (click)="showMore = !showMore">Show + <button class="btn btn-outline-info show-more-button-on-cookie-agreement" (click)="showMore = !showMore">Show {{showMore? "less" : "more"}}</button> <div *ngIf="showMore">