1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

fixing Edge scrolling bug

This commit is contained in:
Patrik J. Braun 2018-05-09 13:37:21 -04:00
parent aafe44b4d2
commit 44cde498ea
3 changed files with 11 additions and 12 deletions

View File

@ -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();
}

View File

@ -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;

View File

@ -91,7 +91,8 @@
"radix": true,
"semicolon": [
true,
"always"
"always",
"ignore-bound-class-methods"
],
"triple-equals": [
true,