From 040d1e8353c4e12f1718622bfb79308167c6d2a3 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 18 Feb 2016 16:42:09 +0000 Subject: [PATCH] Revert part of r55067 - still need that for clicks on suggestions --- etemplate/js/et2_widget_taglist.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etemplate/js/et2_widget_taglist.js b/etemplate/js/et2_widget_taglist.js index 14a78e3395..29520b6ebb 100644 --- a/etemplate/js/et2_widget_taglist.js +++ b/etemplate/js/et2_widget_taglist.js @@ -215,6 +215,17 @@ var et2_taglist = et2_selectbox.extend( // Bind keyup so we can start ajax search when we like .on('keyup.start_search', jQuery.proxy(this._keyup, this)); + // Unbind change handler of widget's ancestor to stop it from bubbling + // taglist has its own onchange + $j(this.getDOMNode()).unbind('change.et2_inputWidget'); + + // This handles clicking on a suggestion from the list in an et2 friendly way + // onChange + if(this.options.onchange && typeof this.onchange === 'function') + { + this.$taglist.on("selectionchange", jQuery.proxy(this.change,this)); + } + // onClick - pass more than baseWidget, so unbind it to avoid double callback if(typeof this.onclick == 'function') {