diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-03-23 21:53:53 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-03-23 21:53:53 +0100 |
commit | 9706388c42b7490cfdbdad8cc32012870211524d (patch) | |
tree | d305e1b42da15d5e8aec1f6d5467d9936b78191a /modules/luci-mod-system/htdocs/luci-static/resources/view/system | |
parent | 41b2fe9f6bfa793329e722b2420d75339cbb0cda (diff) |
luci-mod-system: use generic .cbi-section-actions style for row actions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources/view/system')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js index 560282de77..587f867aa6 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js @@ -36,12 +36,12 @@ return L.view.extend({ }, handleEnableDisable: function(name, isEnabled, ev) { - return this.handleAction(name, isEnabled ? 'disable' : 'enable', ev).then(L.bind(function(name, isEnabled, cell) { - L.dom.content(cell, this.renderEnableDisable({ + return this.handleAction(name, isEnabled ? 'disable' : 'enable', ev).then(L.bind(function(name, isEnabled, btn) { + btn.parentNode.replaceChild(this.renderEnableDisable({ name: name, enabled: isEnabled - })); - }, this, name, !isEnabled, ev.currentTarget.parentNode)); + }), btn); + }, this, name, !isEnabled, ev.currentTarget)); }, handleRcLocalSave: function(ev) { @@ -71,10 +71,7 @@ return L.view.extend({ E('div', { 'class': 'tr table-titles' }, [ E('div', { 'class': 'th' }, _('Start priority')), E('div', { 'class': 'th' }, _('Initscript')), - E('div', { 'class': 'th' }, _('Enable/Disable')), - E('div', { 'class': 'th' }, _('Start')), - E('div', { 'class': 'th' }, _('Restart')), - E('div', { 'class': 'th' }, _('Stop')) + E('div', { 'class': 'th nowrap cbi-section-actions' }) ]) ]); @@ -93,10 +90,12 @@ return L.view.extend({ rows.push([ '%02d'.format(list[i].index), list[i].name, - this.renderEnableDisable(list[i]), - E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'start') }, _('Start')), - E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'restart') }, _('Restart')), - E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'stop') }, _('Stop')) + E('div', [ + this.renderEnableDisable(list[i]), + E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'start') }, _('Start')), + E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'restart') }, _('Restart')), + E('button', { 'class': 'btn cbi-button-action', 'click': ui.createHandlerFn(this, 'handleAction', list[i].name, 'stop') }, _('Stop')) + ]) ]); } |