summaryrefslogtreecommitdiff
path: root/luci2/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-01-31 22:03:21 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-01-31 22:03:21 +0000
commitd6ff503b64b24f2028ebec032945df24eda62074 (patch)
tree303864dc57110d6e7f42fba133db30a22c7eaf47 /luci2/htdocs
parent7172e2c4e2e8176d02d7d6c790c8ebececc383e4 (diff)
downloadluci2-ui-d6ff503b64b24f2028ebec032945df24eda62074.tar.gz
luci2: add primitive initial support for applying uci changes
Diffstat (limited to 'luci2/htdocs')
-rw-r--r--luci2/htdocs/luci2/luci2.js29
1 files changed, 16 insertions, 13 deletions
diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js
index 6f40b77..220e040 100644
--- a/luci2/htdocs/luci2/luci2.js
+++ b/luci2/htdocs/luci2/luci2.js
@@ -3860,20 +3860,23 @@ function LuCI2()
if (n > 0)
$('#changes')
- .empty()
- .show()
- .append($('<a />')
- .attr('href', '#')
- .addClass('label')
- .addClass('notice')
- .text(_luci2.trcp('Pending configuration changes', '1 change', '%d changes', n).format(n))
- .click(function(ev) {
- _luci2.ui.dialog(_luci2.tr('Staged configuration changes'), html, { style: 'close' });
- ev.preventDefault();
- }));
+ .click(function(ev) {
+ _luci2.ui.dialog(_luci2.tr('Staged configuration changes'), html, {
+ style: 'confirm',
+ confirm: function() {
+ _luci2.uci.apply().then(
+ function(code) { alert('Success with code ' + code); },
+ function(code) { alert('Error with code ' + code); }
+ );
+ }
+ });
+ ev.preventDefault();
+ })
+ .children('span')
+ .show()
+ .text(_luci2.trcp('Pending configuration changes', '1 change', '%d changes', n).format(n));
else
- $('#changes')
- .hide();
+ $('#changes').children('span').hide();
});
},