X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/440ad8d3e9fada111bf174d11081c910c361acef..50f19777781cca115e5aef51b2809a54af93da23:/js/kivi.js diff --git a/js/kivi.js b/js/kivi.js index bd169b231..5901c89a1 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -26,6 +26,28 @@ namespace("kivi", function(ns) { ns.setupLocale = function(locale) { ns._locale = locale; }; + + ns.reinit_widgets = function() { + $('.datepicker').each(function() { + $(this).datepicker(); + }); + + if (ns.PartPicker) + $('input.part_autocomplete').each(function(idx, elt){ + kivi.PartPicker($(elt)); + }); + }; + + // Return a function object by its name (a string). Works both with + // global functions (e.g. "check_right_date_format") and those in + // namespaces (e.g. "kivi.t8"). + // Returns null if the object is not found. + ns.get_function_by_name = function(name) { + var parts = name.match("(.+)\\.([^\\.]+)$"); + if (!parts) + return window[name]; + return namespace(parts[1])[ parts[2] ]; + }; }); kivi = namespace('kivi');