From: Alexander Ebert Date: Wed, 13 Sep 2017 10:44:23 +0000 (+0200) Subject: Using `deltaY` instead of `wheelDelta` X-Git-Tag: 3.1.0_Alpha_4~8^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=49273e633869740e017857921b66c8593b5977b7;p=GitHub%2FWoltLab%2FWCF.git Using `deltaY` instead of `wheelDelta` --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js index a8eeeda0ba..a14e54da84 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js @@ -341,11 +341,11 @@ define( dialog.appendChild(contentContainer); contentContainer.addEventListener('wheel', function (event) { - // positive value: scrolling up - if (event.wheelDelta > 0 && contentContainer.scrollTop === 0) { + // negative value: scrolling up + if (event.deltaY < 0 && contentContainer.scrollTop === 0) { event.preventDefault(); } - else if (event.wheelDelta < 0 && (contentContainer.scrollTop + contentContainer.clientHeight === contentContainer.scrollHeight)) { + else if (event.deltaY > 0 && (contentContainer.scrollTop + contentContainer.clientHeight === contentContainer.scrollHeight)) { event.preventDefault(); } }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js index 088426aca7..b2331016ad 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js @@ -104,11 +104,11 @@ define( if (menuHeight === null) menuHeight = menu.clientHeight; if (menuRealHeight === null) menuRealHeight = menu.scrollHeight; - // positive value: scrolling up - if (event.wheelDelta > 0 && menu.scrollTop === 0) { + // negative value: scrolling up + if (event.deltaY < 0 && menu.scrollTop === 0) { event.preventDefault(); } - else if (event.wheelDelta < 0 && (menu.scrollTop + menuHeight === menuRealHeight)) { + else if (event.deltaY > 0 && (menu.scrollTop + menuHeight === menuRealHeight)) { event.preventDefault(); } });