summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-11-08 02:31:41 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-11-08 02:31:41 +0000
commit392bfd38f86f7f5ea23878dbdf96cfe6bd8a2655 (patch)
treea1c026e8bac9fbe79fd08824d3fb458c0a4370fa /libs/cbi/luasrc
parent9199b2ca02510d796be62d9b1fea46aff6dbe05d (diff)
libs/cbi: implement SimpleForm on_cancel hook in main class
Diffstat (limited to 'libs/cbi/luasrc')
-rw-r--r--libs/cbi/luasrc/cbi.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index bfdfd69999..9268d412df 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -671,6 +671,10 @@ function SimpleForm.parse(self, readinput, ...)
return FORM_SKIP
end
+ if self:formvalue("cbi.cancel") and self:_run_hooks("on_cancel") then
+ return FORM_DONE
+ end
+
if self:submitstate() then
Node.parse(self, 1, ...)
end