diff options
Diffstat (limited to 'libs/web/htdocs/luci-static/resources/cbi.js')
-rw-r--r-- | libs/web/htdocs/luci-static/resources/cbi.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index 2bcfb8c3df..be0a5a8d70 100644 --- a/libs/web/htdocs/luci-static/resources/cbi.js +++ b/libs/web/htdocs/luci-static/resources/cbi.js @@ -402,6 +402,23 @@ function cbi_filebrowser(id, url, defpath) { browser.focus(); } +function cbi_browser_init(id, respath, url, defpath) +{ + function cbi_browser_btnclick(e) { + cbi_filebrowser(id, url, defpath); + return false; + } + + var field = document.getElementById(id); + + var btn = document.createElement('img'); + btn.className = 'cbi-image-button'; + btn.src = respath + '/cbi/folder.gif'; + field.parentNode.insertBefore(btn, field.nextSibling); + + cbi_bind(btn, 'click', cbi_browser_btnclick); +} + function cbi_dynlist_init(name, respath) { function cbi_dynlist_renumber(e) @@ -587,6 +604,7 @@ function cbi_dynlist_init(name, respath) for( var i = 0; i < inputs.length; i++ ) { var btn = document.createElement('img'); + btn.className = 'cbi-image-button'; btn.src = respath + ( (i+1) < inputs.length ? '/cbi/remove.gif' : '/cbi/add.gif' ); |