fix select(-account) tags=true widget to not call onchange callback twice with different signature, now signature is onchange(_node, _widget, _change)

This commit is contained in:
Ralf Becker 2017-01-30 14:43:46 +01:00
parent 1bfa02f0ed
commit f45105c3ed

View File

@ -709,8 +709,21 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
inherit_select_classes: true,
search_contains: true,
width: _width || size.w + "px"
})
.change(this.onchange);
});
if(this.options.onchange)
{
// Unbind change handler of widget's ancestor to stop it from bubbling
// chosen has its own onchange
jQuery(this.input).unbind('change.et2_inputWidget');
var self = this;
this.input.chosen().change(function(_ev, _change)
{
// enhance signature of regular et2_selectbox.onchange with 3. parameter from chosen
self.change.call(self, self.input, self, _change);
});
}
// multi selection with limited show line of single row
if (this.options.multiple && this.options.rows == 1 && this.options.height)