luci-base: ui.js: fix function declaration in nested statement 4092/head
authorAnton Kikin <a.kikin@tano-systems.com>
Sat, 23 May 2020 23:12:20 +0000 (02:12 +0300)
committerAnton Kikin <a.kikin@tano-systems.com>
Sat, 23 May 2020 23:12:20 +0000 (02:12 +0300)
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>
modules/luci-base/htdocs/luci-static/resources/ui.js

index 1f9a436f1387fbe9d2059afb214e055048969d94..a6598355d67a217a03c6c788e06a0fe188fed913 100644 (file)
@@ -1176,7 +1176,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');