mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-29 22:17:14 +00:00
Fix: hide slim sidebar scrollbar in browsers with stupid scrollbars (#13837)
This commit is contained in:
@@ -118,6 +118,7 @@ export class AppFrameComponent
|
||||
|
||||
ngOnInit(): void {
|
||||
this.lastScrollY = window.scrollY
|
||||
this.detectClassicScrollbars()
|
||||
|
||||
if (this.settingsService.get(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED)) {
|
||||
this.checkForUpdates()
|
||||
@@ -343,6 +344,22 @@ export class AppFrameComponent
|
||||
this.lastScrollY = currentScrollY
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag for browsers whose scrollbars take up layout width. Remove me
|
||||
* some day, I hope.
|
||||
*/
|
||||
private detectClassicScrollbars(): void {
|
||||
const probe = document.createElement('div')
|
||||
probe.style.cssText =
|
||||
'position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll'
|
||||
document.body.appendChild(probe)
|
||||
document.documentElement.classList.toggle(
|
||||
'pngx-classic-scrollbars',
|
||||
probe.offsetWidth > probe.clientWidth
|
||||
)
|
||||
probe.remove()
|
||||
}
|
||||
|
||||
private isMobileViewport(): boolean {
|
||||
return window.innerWidth < 768
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user