From de7d633bd7cc23d1ebb3db5845eb0e506f603863 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 10 Jun 2013 16:53:41 +0000 Subject: [PATCH] Make account quick search add to selection instead of replacing it --- etemplate/js/et2_widget_selectAccount.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index 643054dce5..6c0f32077b 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -162,9 +162,20 @@ var et2_selectAccount = et2_selectbox.extend( // Clear search box after select var old_select = this.search_widget.select; - this.search_widget.select = function() { + var self = this; + this.search_widget.select = function(e, selected) { + var current = self.getValue(); + + // This one is important, it makes sure the option is there old_select.apply(this, arguments); + + // Add quick search selection into current selection + current.push(selected.item.value); + + // Clear search this.search.val(''); + + self.set_value(current); }; // Put search results as a DOM sibling of the options, for proper display