summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cbi')
-rw-r--r--libs/cbi/luasrc/cbi.lua2
-rw-r--r--libs/cbi/luasrc/view/cbi/footer.htm4
2 files changed, 4 insertions, 2 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 94ac96483..316b74f35 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -322,7 +322,7 @@ function Map.parse(self)
for i, config in ipairs(self.parsechain) do
self.uci:save(config)
end
- if luci.http.formvalue("cbi.apply") then
+ if self:submitstate() and (self.autoapply or luci.http.formvalue("cbi.apply")) then
for i, config in ipairs(self.parsechain) do
self.uci:commit(config)
diff --git a/libs/cbi/luasrc/view/cbi/footer.htm b/libs/cbi/luasrc/view/cbi/footer.htm
index da5926601..6f90bb9cf 100644
--- a/libs/cbi/luasrc/view/cbi/footer.htm
+++ b/libs/cbi/luasrc/view/cbi/footer.htm
@@ -14,7 +14,9 @@ $Id$
-%>
<div class="cbi-page-actions">
- <input class="cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:saveapply%>" />
+ <% if not autoapply then%>
+ <input class="cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:saveapply%>" />
+ <% end %>
<input class="cbi-button cbi-button-save" type="submit" value="<%:save%>" />
<input class="cbi-button cbi-button-reset" type="reset" value="<%:reset%>" />
<script type="text/javascript">cbi_d_update();</script>