When taglist is single, expand on click anywhere in the widget (except x)

This commit is contained in:
Nathan Gray 2016-03-10 18:00:24 +00:00
parent a397de82d2
commit 24a3478b25

View File

@ -593,7 +593,14 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR
this._multiple = multiple === true ? true : false; this._multiple = multiple === true ? true : false;
this.div.toggleClass('et2_taglist_single', !this._multiple) this.div.toggleClass('et2_taglist_single', !this._multiple)
.toggleClass('et2_taglist_toggle', this.options.multiple === 'toggle') .toggleClass('et2_taglist_toggle', this.options.multiple === 'toggle')
.removeClass('ui-state-hover'); .removeClass('ui-state-hover')
.off('click.single');
if(this._multiple == false)
{
this.div.on('click.single', jQuery.proxy(function() {
this.taglist.expand();
},this));
}
this.taglist.setMaxSelection(this._multiple ? this.options.maxSelection : 1); this.taglist.setMaxSelection(this._multiple ? this.options.maxSelection : 1);
if(!this._multiple && this.taglist.getValue().length > 1) if(!this._multiple && this.taglist.getValue().length > 1)
{ {