diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2017-07-21 20:09:43 +0800 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2017-07-21 20:34:46 +0800 |
commit | c759500d49af8bef454eb119eb7e0f21f86380c0 (patch) | |
tree | 99b9bb2b447cf8b44181dc9e4ec0f1099e2f0850 /modules/luci-base | |
parent | 2224714217105b1482dab63842409bb62154230d (diff) |
luci-base: fix loading fold.gif for filebrowser
cbi_init() needs to be called at the end of the page to initialize
cbi_strings with "[data-strings]" while cbi_browser_init() happened
before that.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 8e66cbc380..4be917d098 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -727,7 +727,7 @@ function cbi_filebrowser(id, defpath) { browser.focus(); } -function cbi_browser_init(id, defpath) +function cbi_browser_init(id, resource, defpath) { function cbi_browser_btnclick(e) { cbi_filebrowser(id, defpath); @@ -738,7 +738,7 @@ function cbi_browser_init(id, defpath) var btn = document.createElement('img'); btn.className = 'cbi-image-button'; - btn.src = cbi_strings.path.resource + '/cbi/folder.gif'; + btn.src = (resource || cbi_strings.path.resource) + '/cbi/folder.gif'; field.parentNode.insertBefore(btn, field.nextSibling); cbi_bind(btn, 'click', cbi_browser_btnclick); @@ -805,7 +805,7 @@ function cbi_dynlist_init(parent, datatype, optional, choices) parent.appendChild(b); if (datatype == 'file') { - cbi_browser_init(t.id, parent.getAttribute('data-browser-path')); + cbi_browser_init(t.id, null, parent.getAttribute('data-browser-path')); } parent.appendChild(document.createElement('br')); |