Extend CBI state handling
[project/luci.git] / libs / web / luasrc / dispatcher.lua
index 51f6d96..22d9dd9 100644 (file)
@@ -521,6 +521,12 @@ function cbi(model, config)
                        end
                end
 
                        end
                end
 
+               if config.state_handler then
+                       if not config.state_handler(state, maps) then
+                               return
+                       end
+               end
+
                local pageaction = true
                http.header("X-CBI-State", state or 0)
                luci.template.render("cbi/header", {state = state})
                local pageaction = true
                http.header("X-CBI-State", state or 0)
                luci.template.render("cbi/header", {state = state})