From: Florian Eckert Date: Fri, 7 Jun 2024 08:01:31 +0000 (+0200) Subject: luci-base: move cancel button to the top X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fca31270aaaa7bdb6f4f9c4f476a46f933d20075;p=project%2Fluci.git luci-base: move cancel button to the top This change is required, so that the cancel button is the first and thus closes the modal when the 'ESC' button is pressed. Signed-off-by: Florian Eckert --- diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index d1945a84d8..9050b10521 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -4210,6 +4210,13 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ { UI.prototype.showModal(_('Uploading file…'), [ E('p', _('Please select the file to upload.')), E('div', { 'class': 'right' }, [ + E('div', { + 'class': 'btn cbi-button', + 'click': function() { + UI.prototype.hideModal(); + rejectFn(new Error(_('Upload has been cancelled'))); + } + }, [ _('Cancel') ]), E('input', { type: 'file', style: 'display:none', @@ -4239,14 +4246,6 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ { ev.target.previousElementSibling.click(); } }, [ _('Browse…') ]), - E('div', { - 'class': 'btn cbi-button', - 'click': function() { - UI.prototype.hideModal(); - rejectFn(new Error(_('Upload has been cancelled'))); - } - }, [ _('Cancel') ]), - ' ', E('div', { 'class': 'btn cbi-button-action important', 'disabled': true,