Revision b9f5d35e
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
js/kivi.js | ||
---|---|---|
313 | 313 |
history.back(); |
314 | 314 |
}; |
315 | 315 |
|
316 |
// Call arbitrary jQuery functions on arbitrary objects with |
|
317 |
// arbitrary arguments. The use case is to allow eval_json_result |
|
318 |
// using code to call simple jQuery stuff without having it to wrap |
|
319 |
// them in their own small functions. |
|
320 |
// Example usage with ActionBar: |
|
321 |
// call => [ 'kivi.call_jquery', '#form', 'resetForm' ], |
|
322 |
ns.call_jquery = function(this_arg, function_name) { |
|
323 |
var func = jQuery.fn[function_name]; |
|
324 |
if (!func) |
|
325 |
return; |
|
326 |
|
|
327 |
var args = Array.from(arguments); |
|
328 |
args.splice(0, 2); |
|
329 |
|
|
330 |
return func.apply($(this_arg), args); |
|
331 |
}; |
|
332 |
|
|
333 | 316 |
// Return a function object by its name (a string). Works both with |
334 | 317 |
// global functions (e.g. "check_right_date_format") and those in |
335 | 318 |
// namespaces (e.g. "kivi.t8"). |
Auch abrufbar als: Unified diff
Revert "kivi.call_jquery: Funktion zum Aufrufen beliebiger jQuery-Funktionen"
Dies nimmt Commit 8c93869920ec0bf012a0f59175b39449c90a4d1f zurück. War
kein schönes Design, und die Aufrufer wurden bereits auf andere
Interfaces umgestellt.