From 351976614ad03bdfa96de1288eb6dd15b637dc5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 3 Jun 2020 18:18:33 +0200 Subject: [PATCH] Allow specifying a dedicated overflow container in WoltLabSuite/Core/Bbcode/Collapsible --- .../files/js/WoltLabSuite/Core/Bbcode/Collapsible.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); } -- 2.20.1