From: Sven Schöling Date: Mon, 10 Oct 2016 12:23:19 +0000 (+0200) Subject: ActionBar: checks korrekt interpretieren X-Git-Tag: release-3.5.4~1414 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3ab818312b91e25f4a1081214d2f7ed4f78b9b9a;p=kivitendo-erp.git ActionBar: checks korrekt interpretieren --- diff --git a/js/kivi.ActionBar.js b/js/kivi.ActionBar.js index 2c28d9b4c..6e7cc165b 100644 --- a/js/kivi.ActionBar.js +++ b/js/kivi.ActionBar.js @@ -11,12 +11,14 @@ namespace('kivi', function(k){ var form = data.submit[0]; var params = data.submit[1]; $(e).click(function(event) { - var $hidden, key, func; + var $hidden, key, func, check; if (data.disabled) return; if (data.confirm && !confirm(data.confirm)) return; if (data.checks) { - for (var check in data.check) { + for (var i=0; i < data.checks.length; i++) { + check = data.checks[i]; func = kivi.get_function_by_name(check); + if (!func) console.log('Cannot find check function: ' + check); if (!func()) return; } } @@ -30,14 +32,15 @@ namespace('kivi', function(k){ }) } else if (data.function) { // TODO: what to do with templated calls - console.log(data.function) $(e).click(function(event) { var func; if (data.disabled) return; if (data.confirm && !confirm(data.confirm)) return; if (data.checks) { - for (var check in data.check) { + for (var i=0; i < data.checks.length; i++) { + check = data.checks[i]; func = kivi.get_function_by_name(check); + if (!func) console.log('Cannot find check function: ' + check); if (!func()) return; } }