From: Jo-Philipp Wich Date: Sun, 8 Nov 2009 02:31:41 +0000 (+0000) Subject: libs/cbi: implement SimpleForm on_cancel hook in main class X-Git-Tag: 0.10.0~983 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=392bfd38f86f7f5ea23878dbdf96cfe6bd8a2655;p=oweals%2Fluci.git libs/cbi: implement SimpleForm on_cancel hook in main class --- diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index bfdfd6999..9268d412d 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