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) {
|
private _navigation: NavigationService) {
|
||||||
this.mapEnabled = Config.Client.Map.enabled;
|
this.mapEnabled = Config.Client.Map.enabled;
|
||||||
|
|
||||||
|
document.getElementsByTagName('body')[0].style.overflowY = 'scroll';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTimer(t: number) {
|
updateTimer(t: number) {
|
||||||
@ -129,7 +131,7 @@ export class GalleryComponent implements OnInit, OnDestroy {
|
|||||||
await this.shareService.wait();
|
await this.shareService.wait();
|
||||||
if (!this._authService.isAuthenticated() &&
|
if (!this._authService.isAuthenticated() &&
|
||||||
(!this.shareService.isSharing() ||
|
(!this.shareService.isSharing() ||
|
||||||
(this.shareService.isSharing() && Config.Client.Sharing.passwordProtected == true))) {
|
(this.shareService.isSharing() && Config.Client.Sharing.passwordProtected === true))) {
|
||||||
|
|
||||||
return this._navigation.toLogin();
|
return this._navigation.toLogin();
|
||||||
}
|
}
|
||||||
|
@ -8,39 +8,35 @@ export class OverlayService {
|
|||||||
private scrollWidth: number = null;
|
private scrollWidth: number = null;
|
||||||
|
|
||||||
public showOverlay() {
|
public showOverlay() {
|
||||||
|
|
||||||
// disable scrolling
|
// disable scrolling
|
||||||
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
|
document.getElementsByTagName('body')[0].style.overflowY = 'hidden';
|
||||||
this.OnOverlayChange.trigger(true);
|
this.OnOverlayChange.trigger(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public hideOverlay() {
|
public hideOverlay() {
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].style.overflowY = 'scroll';
|
document.getElementsByTagName('body')[0].style.overflowY = 'scroll';
|
||||||
this.OnOverlayChange.trigger(false);
|
this.OnOverlayChange.trigger(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
getScrollbarWidth() {
|
getScrollbarWidth() {
|
||||||
if (this.scrollWidth == null) {
|
if (this.scrollWidth == null) {
|
||||||
|
const outer = document.createElement('div');
|
||||||
|
|
||||||
let outer = document.createElement('div');
|
|
||||||
outer.style.visibility = 'hidden';
|
outer.style.visibility = 'hidden';
|
||||||
outer.style.width = '100px';
|
outer.style.width = '100px';
|
||||||
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
|
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
|
||||||
|
|
||||||
document.body.appendChild(outer);
|
document.body.appendChild(outer);
|
||||||
|
|
||||||
let widthNoScroll = outer.offsetWidth;
|
const widthNoScroll = outer.offsetWidth;
|
||||||
// force scrollbars
|
// force scrollbars
|
||||||
outer.style.overflowY = 'scroll';
|
outer.style.overflowY = 'scroll';
|
||||||
|
|
||||||
// add innerdiv
|
// add innerdiv
|
||||||
let inner = document.createElement('div');
|
const inner = document.createElement('div');
|
||||||
inner.style.width = '100%';
|
inner.style.width = '100%';
|
||||||
outer.appendChild(inner);
|
outer.appendChild(inner);
|
||||||
|
|
||||||
let widthWithScroll = inner.offsetWidth;
|
const widthWithScroll = inner.offsetWidth;
|
||||||
|
|
||||||
// remove divs
|
// remove divs
|
||||||
outer.parentNode.removeChild(outer);
|
outer.parentNode.removeChild(outer);
|
||||||
@ -51,7 +47,7 @@ export class OverlayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPhantomScrollbarWidth() {
|
getPhantomScrollbarWidth() {
|
||||||
if (document.getElementsByTagName('body')[0].style.overflowY == 'hidden') {
|
if (document.getElementsByTagName('body')[0].style.overflowY === 'hidden') {
|
||||||
return this.getScrollbarWidth();
|
return this.getScrollbarWidth();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -91,7 +91,8 @@
|
|||||||
"radix": true,
|
"radix": true,
|
||||||
"semicolon": [
|
"semicolon": [
|
||||||
true,
|
true,
|
||||||
"always"
|
"always",
|
||||||
|
"ignore-bound-class-methods"
|
||||||
],
|
],
|
||||||
"triple-equals": [
|
"triple-equals": [
|
||||||
true,
|
true,
|
||||||
|
Loading…
Reference in New Issue
Block a user