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:
parent
aafe44b4d2
commit
44cde498ea
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -91,7 +91,8 @@
|
||||
"radix": true,
|
||||
"semicolon": [
|
||||
true,
|
||||
"always"
|
||||
"always",
|
||||
"ignore-bound-class-methods"
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user