Bind onchange handlers of taglist options only to magicsuggest selectionchange, avoid unwanted triggered inputWidget parent change

This commit is contained in:
Hadi Nategh 2014-12-16 14:22:54 +00:00
parent f529a4fae6
commit 0f32084f8d

View File

@ -186,9 +186,9 @@ var et2_taglist = et2_selectbox.extend(
.on("load", function() {$j('.loading',this.container).remove();});
// onChange
if(this.options.onchange)
if(this.options.onchange && typeof this.options.onchange == 'function')
{
$j(this.taglist).on("selectionchange", jQuery.proxy(this.change,this));
$j(this.taglist).on("selectionchange", this.options.onchange);
}
// onClick - pass more than baseWidget, so unbind it to avoid double callback