luci-mod-system: flash.js: fix passing sysupgrade opts
Instead of binding the checked state to the button handler function, bind the underlying checkboxes instead to observe the actual user choice instead of the initial value. This fixes forcing sysupgrade or deselecting keep settings. Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
e7ca163d7c
commit
5ccbda54e8
1 changed files with 3 additions and 3 deletions
|
@ -342,7 +342,7 @@ return L.view.extend({
|
|||
|
||||
var cntbtn = E('button', {
|
||||
'class': 'btn cbi-button-action important',
|
||||
'click': L.ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep.checked, force.checked),
|
||||
'click': L.ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, force),
|
||||
'disabled': (!is_valid || is_too_big) ? true : null
|
||||
}, [ _('Continue') ]);
|
||||
|
||||
|
@ -376,10 +376,10 @@ return L.view.extend({
|
|||
|
||||
var opts = [];
|
||||
|
||||
if (!keep)
|
||||
if (!keep.checked)
|
||||
opts.push('-n');
|
||||
|
||||
if (force)
|
||||
if (force.checked)
|
||||
opts.push('--force');
|
||||
|
||||
opts.push('/tmp/firmware.bin');
|
||||
|
|
Loading…
Reference in a new issue