summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/luci.js
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-17 07:03:27 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-17 07:03:27 +0200
commit9ecfe33edd835672226279b7c77fbfe4e2b6034b (patch)
tree082a570bcdf70940e6ca54f5cd613464a77247ee /modules/luci-base/htdocs/luci-static/resources/luci.js
parent96fbca76c824a00cb7e04519f5cd4baf9d64c8be (diff)
luci-base: luci.js: render view buttons depending on available functions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources/luci.js')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/luci.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js
index bcc6870bd..0b7ec6ea8 100644
--- a/modules/luci-base/htdocs/luci-static/resources/luci.js
+++ b/modules/luci-base/htdocs/luci-static/resources/luci.js
@@ -1337,23 +1337,22 @@
},
addFooter: function() {
- var footer = E([]),
- mc = document.getElementById('maincontent');
+ var footer = E([]);
- if (mc.querySelector('.cbi-map')) {
+ if (this.handleSaveApply || this.handleSave || this.handleReset) {
footer.appendChild(E('div', { 'class': 'cbi-page-actions' }, [
- E('button', {
+ this.handleSaveApply ? E('button', {
'class': 'cbi-button cbi-button-apply',
'click': L.ui.createHandlerFn(this, 'handleSaveApply')
- }, _('Save & Apply')), ' ',
- E('button', {
+ }, _('Save & Apply')) : '', ' ',
+ this.handleSave ? E('button', {
'class': 'cbi-button cbi-button-save',
'click': L.ui.createHandlerFn(this, 'handleSave')
- }, _('Save')), ' ',
- E('button', {
+ }, _('Save')) : '', ' ',
+ this.handleReset ? E('button', {
'class': 'cbi-button cbi-button-reset',
'click': L.ui.createHandlerFn(this, 'handleReset')
- }, _('Reset'))
+ }, _('Reset')) : ''
]));
}