Revision 3ab81831
Von Sven Schöling vor mehr als 7 Jahren hinzugefügt
js/kivi.ActionBar.js | ||
---|---|---|
11 | 11 |
var form = data.submit[0]; |
12 | 12 |
var params = data.submit[1]; |
13 | 13 |
$(e).click(function(event) { |
14 |
var $hidden, key, func; |
|
14 |
var $hidden, key, func, check;
|
|
15 | 15 |
if (data.disabled) return; |
16 | 16 |
if (data.confirm && !confirm(data.confirm)) return; |
17 | 17 |
if (data.checks) { |
18 |
for (var check in data.check) { |
|
18 |
for (var i=0; i < data.checks.length; i++) { |
|
19 |
check = data.checks[i]; |
|
19 | 20 |
func = kivi.get_function_by_name(check); |
21 |
if (!func) console.log('Cannot find check function: ' + check); |
|
20 | 22 |
if (!func()) return; |
21 | 23 |
} |
22 | 24 |
} |
... | ... | |
30 | 32 |
}) |
31 | 33 |
} else if (data.function) { |
32 | 34 |
// TODO: what to do with templated calls |
33 |
console.log(data.function) |
|
34 | 35 |
$(e).click(function(event) { |
35 | 36 |
var func; |
36 | 37 |
if (data.disabled) return; |
37 | 38 |
if (data.confirm && !confirm(data.confirm)) return; |
38 | 39 |
if (data.checks) { |
39 |
for (var check in data.check) { |
|
40 |
for (var i=0; i < data.checks.length; i++) { |
|
41 |
check = data.checks[i]; |
|
40 | 42 |
func = kivi.get_function_by_name(check); |
43 |
if (!func) console.log('Cannot find check function: ' + check); |
|
41 | 44 |
if (!func()) return; |
42 | 45 |
} |
43 | 46 |
} |
Auch abrufbar als: Unified diff
ActionBar: checks korrekt interpretieren