From fca31270aaaa7bdb6f4f9c4f476a46f933d20075 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 7 Jun 2024 10:01:31 +0200 Subject: [PATCH] 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 --- .../luci-base/htdocs/luci-static/resources/ui.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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, -- 2.30.2