From: Sven Schöling Date: Thu, 2 Feb 2017 10:15:01 +0000 (+0100) Subject: kivi.js + kivi.Part.js: reinit_widgets verschoben X-Git-Tag: release-3.5.4~1468 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=50b582671d7e0d2eac3a9393d970675b07277800;p=kivitendo-erp.git kivi.js + kivi.Part.js: reinit_widgets verschoben --- diff --git a/js/kivi.Part.js b/js/kivi.Part.js index 843c43287..aa1e57a58 100644 --- a/js/kivi.Part.js +++ b/js/kivi.Part.js @@ -571,6 +571,12 @@ namespace('kivi.Part', function(ns) { return pp; }; + ns.reinit_widgets = function() { + kivi.run_once_for('input.part_autocomplete', 'part_picker', function(elt) { + kivi.Part.Picker($(elt)); + }); + } + $(function(){ // assortment @@ -613,8 +619,6 @@ namespace('kivi.Part', function(ns) { $('#part_warehouse_id').change(kivi.Part.reload_bin_selection); - $('input.part_autocomplete').each(function(i,real){ - kivi.Part.Picker($(real)); - }); + ns.reinit_widgets(); }); }); diff --git a/js/kivi.js b/js/kivi.js index 0372f40d3..542c663c2 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -243,10 +243,7 @@ namespace("kivi", function(ns) { $(elt).datepicker(); }); - if (ns.Part) - ns.run_once_for('input.part_autocomplete', 'part_picker', function(elt) { - kivi.Part.Picker($(elt)); - }); + if (ns.Part) ns.Part.reinit_widgets(); if (ns.ProjectPicker) ns.run_once_for('input.project_autocomplete', 'project_picker', function(elt) {