diff --git a/frontend/app/gallery/gallery.component.ts b/frontend/app/gallery/gallery.component.ts index 7aa5c1f..79e7383 100644 --- a/frontend/app/gallery/gallery.component.ts +++ b/frontend/app/gallery/gallery.component.ts @@ -45,6 +45,8 @@ export class GalleryComponent implements OnInit, OnDestroy { private _navigation: NavigationService) { this.mapEnabled = Config.Client.Map.enabled; + document.getElementsByTagName('body')[0].style.overflowY = 'scroll'; + } updateTimer(t: number) { @@ -129,7 +131,7 @@ export class GalleryComponent implements OnInit, OnDestroy { await this.shareService.wait(); if (!this._authService.isAuthenticated() && (!this.shareService.isSharing() || - (this.shareService.isSharing() && Config.Client.Sharing.passwordProtected == true))) { + (this.shareService.isSharing() && Config.Client.Sharing.passwordProtected === true))) { return this._navigation.toLogin(); } diff --git a/frontend/app/gallery/overlay.service.ts b/frontend/app/gallery/overlay.service.ts index 5e4fc01..9df3307 100644 --- a/frontend/app/gallery/overlay.service.ts +++ b/frontend/app/gallery/overlay.service.ts @@ -8,39 +8,35 @@ export class OverlayService { private scrollWidth: number = null; public showOverlay() { - - //disable scrolling + // disable scrolling document.getElementsByTagName('body')[0].style.overflowY = 'hidden'; this.OnOverlayChange.trigger(true); } public hideOverlay() { - document.getElementsByTagName('body')[0].style.overflowY = 'scroll'; this.OnOverlayChange.trigger(false); } getScrollbarWidth() { if (this.scrollWidth == null) { - - - let outer = document.createElement('div'); + const outer = document.createElement('div'); outer.style.visibility = 'hidden'; outer.style.width = '100px'; outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps document.body.appendChild(outer); - let widthNoScroll = outer.offsetWidth; + const widthNoScroll = outer.offsetWidth; // force scrollbars outer.style.overflowY = 'scroll'; // add innerdiv - let inner = document.createElement('div'); + const inner = document.createElement('div'); inner.style.width = '100%'; outer.appendChild(inner); - let widthWithScroll = inner.offsetWidth; + const widthWithScroll = inner.offsetWidth; // remove divs outer.parentNode.removeChild(outer); @@ -51,7 +47,7 @@ export class OverlayService { } getPhantomScrollbarWidth() { - if (document.getElementsByTagName('body')[0].style.overflowY == 'hidden') { + if (document.getElementsByTagName('body')[0].style.overflowY === 'hidden') { return this.getScrollbarWidth(); } return 0; diff --git a/tslint.json b/tslint.json index 9963d6c..f4cc662 100644 --- a/tslint.json +++ b/tslint.json @@ -91,7 +91,8 @@ "radix": true, "semicolon": [ true, - "always" + "always", + "ignore-bound-class-methods" ], "triple-equals": [ true,