Skip to content

Commit 8f33534

Browse files
committed
Delegate the scroll suppression in Fancybox to the Core
See https://www.woltlab.com/community/thread/314223/
1 parent c0d8d2e commit 8f33534

File tree

2 files changed

+25
-1
lines changed
  • ts/WoltLabSuite/Core/Component/Image
  • wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image

2 files changed

+25
-1
lines changed

ts/WoltLabSuite/Core/Component/Image/Viewer.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Fancybox, CarouselSlide, FancyboxInstance } from "@fancyapps/ui";
88
import { getPageOverlayContainer } from "WoltLabSuite/Core/Helper/PageOverlay";
99
import { getPhrase } from "WoltLabSuite/Core/Language";
1010
import { ConsentPlugin } from "./Fancybox/ConsentPlugin";
11+
import { scrollDisable, scrollEnable } from "WoltLabSuite/Core/Ui/Screen";
1112

1213
setDefaultConfig();
1314

@@ -42,6 +43,18 @@ function setDefaultConfig(): void {
4243
defaultConfig.plugins.consent = () => {
4344
return new ConsentPlugin();
4445
};
46+
47+
// Delegate the handling of the scroll suppression to our own implementation.
48+
defaultConfig.hideClass = false;
49+
defaultConfig.hideScrollbar = false;
50+
defaultConfig.on = {
51+
ready() {
52+
scrollDisable();
53+
},
54+
close() {
55+
scrollEnable();
56+
},
57+
};
4558
}
4659

4760
export function getLocalization(): Record<string, string> {

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image/Viewer.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)