From 2c9ffb39b92002a4119f0b883e684b28e363350f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 2 Jul 2014 14:36:47 +0000 Subject: [PATCH] Override attchToDOM method in selectAccount, because chosen needs to be set after widget dettached from DOM (eg. validation error) --- etemplate/js/et2_widget_selectAccount.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index 5b1f32040b..8813d4b377 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -747,6 +747,20 @@ var et2_selectAccount = et2_selectbox.extend( .addClass("loading") .appendTo(option); this.egw().link_title('home-accounts', value, function(name) {this.text(name).removeClass("loading");}, label); + }, + + /** + * Overwritten attachToDOM metod to modify attachToDOM + */ + attachToDOM: function () + { + this._super.apply(this, arguments); + //Chosen needs to be set after widget dettached from DOM (eg. validation_error), because chosen is not part of the widget node + if (this.egw().preference('account_selection', 'common') == 'primary_group') + { + jQuery(this.node).removeClass('chzn-done'); + this.set_tags(this.options.tags, this.options.width); + } } }); et2_register_widget(et2_selectAccount, ["select-account"]);