luci-base: ui.js: fix function declaration in nested statement
authorAnton Kikin <a.kikin@tano-systems.com>
Sat, 23 May 2020 23:12:20 +0000 (02:12 +0300)
committerJo-Philipp Wich <jo@mein.io>
Sun, 24 May 2020 16:25:00 +0000 (18:25 +0200)
Fix "SyntaxError: Strict mode does not allow function declarations
in a lexically nested statement" error that may occur in some old
browsers (detected on QtWebKit 5.212).

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
(cherry picked from commit c00d0d9473803eec3248f0f6d7f3404923c80514)

modules/luci-base/htdocs/luci-static/resources/ui.js

index bad415b30b6511bcdbfc212db3f82b2f280e4170..8f81576344b08a99d771a3967d75819d32fdbeb8 100644 (file)
@@ -1179,7 +1179,7 @@ var UIDropdown = UIElement.extend(/** @lends LuCI.ui.Dropdown.prototype */ {
                        ul.style.maxHeight = (vpHeight * 0.5) + 'px';
                        ul.style.WebkitOverflowScrolling = 'touch';
 
-                       function getScrollParent(element) {
+                       var getScrollParent = function(element) {
                                var parent = element,
                                    style = getComputedStyle(element),
                                    excludeStaticParent = (style.position === 'absolute');