From: Tim Düsterhus Date: Wed, 3 Jun 2020 16:18:33 +0000 (+0200) Subject: Allow specifying a dedicated overflow container in WoltLabSuite/Core/Bbcode/Collapsible X-Git-Tag: 5.3.0_Alpha_1~224^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=351976614ad03bdfa96de1288eb6dd15b637dc5d;p=GitHub%2FWoltLab%2FWCF.git Allow specifying a dedicated overflow container in WoltLabSuite/Core/Bbcode/Collapsible --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Collapsible.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Collapsible.js index 7f6416ce7f..a691f67a7d 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Collapsible.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Collapsible.js @@ -16,7 +16,7 @@ define([], function() { */ return { observe: function() { - var container, toggleButtons; + var container, toggleButtons, overflowContainer; while (_containers.length) { container = _containers[0]; @@ -28,6 +28,7 @@ define([], function() { toggleButtons.push(button); } }); + overflowContainer = elBySel('.collapsibleBbcodeOverflow', container) || container; if (toggleButtons.length > 0) { (function (container, toggleButtons) { @@ -74,10 +75,10 @@ define([], function() { }); // expand boxes that are initially scrolled - if (container.scrollTop !== 0) { + if (overflowContainer.scrollTop !== 0) { toggle(); } - container.addEventListener('scroll', function () { + overflowContainer.addEventListener('scroll', function () { if (container.classList.contains('collapsed')) { toggle(); }