diff options
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index ffa36402a..2e360410d 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -2277,7 +2277,23 @@ return L.Class.extend({ type: 'file', style: 'display:none', change: function(ev) { - L.dom.parent(ev.target, '.modal').querySelector('.cbi-button-action.important').disabled = false; + var modal = L.dom.parent(ev.target, '.modal'), + body = modal.querySelector('p'), + upload = modal.querySelector('.cbi-button-action.important'), + file = ev.currentTarget.files[0]; + + if (file == null) + return; + + L.dom.content(body, [ + E('ul', {}, [ + E('li', {}, [ '%s: %s'.format(_('Name'), file.name.replace(/^.*[\\\/]/, '')) ]), + E('li', {}, [ '%s: %1024mB'.format(_('Size'), file.size) ]) + ]) + ]); + + upload.disabled = false; + upload.focus(); } }), E('button', { |