From: Moritz Bunkus Date: Fri, 16 Aug 2013 10:47:00 +0000 (+0200) Subject: JS-Setup: kivi.reinit_widgets() nutzen und dort Controls nur einmalig initialisieren X-Git-Tag: release-3.1.0beta1~83 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=abead59dc75d6ffd40daa10695bcab8410c38978;p=kivitendo-erp.git JS-Setup: kivi.reinit_widgets() nutzen und dort Controls nur einmalig initialisieren --- diff --git a/js/kivi.js b/js/kivi.js index a39820ae1..2c2811027 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -28,12 +28,12 @@ namespace("kivi", function(ns) { }; ns.reinit_widgets = function() { - $('.datepicker').each(function() { - $(this).datepicker(); + ns.run_once_for('.datepicker', 'datepicker', function(elt) { + $(elt).datepicker(); }); if (ns.PartPicker) - $('input.part_autocomplete').each(function(idx, elt){ + ns.run_once_for('input.part_autocomplete', 'part_picker', function(elt) { kivi.PartPicker($(elt)); }); }; diff --git a/templates/webpages/layout/javascript_setup.js b/templates/webpages/layout/javascript_setup.js index dc516348c..8a060425e 100644 --- a/templates/webpages/layout/javascript_setup.js +++ b/templates/webpages/layout/javascript_setup.js @@ -15,9 +15,7 @@ $(function() { buttonImageOnly: true })); - $('.datepicker').each(function() { - $(this).datepicker(); - }); + kivi.reinit_widgets(); [% END %] [% IF ajax_spinner %]