forked from extern/egroupware
Add setter method for tags attribute
This commit is contained in:
parent
7335f1808a
commit
ce5d6faa0a
@ -414,18 +414,8 @@ var et2_selectbox = et2_inputWidget.extend(
|
|||||||
doLoadingFinished: function() {
|
doLoadingFinished: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
// Turn on tags, if desired
|
this.set_tags(this.options.tags);
|
||||||
if(this.input != null && (this.options.search || this.options.tags) && !this.options.disabled)
|
|
||||||
{
|
|
||||||
if(this.options.empty_label)
|
|
||||||
{
|
|
||||||
this.input.attr("data-placeholder", this.options.empty_label);
|
|
||||||
}
|
|
||||||
this.input.css("width","100%")
|
|
||||||
.chosen({
|
|
||||||
})
|
|
||||||
.change(this.onchange);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -535,6 +525,36 @@ var et2_selectbox = et2_inputWidget.extend(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn tag style on and off
|
||||||
|
*/
|
||||||
|
set_tags: function(tags) {
|
||||||
|
this.options.tags = tags;
|
||||||
|
|
||||||
|
// Can't actually do chosen until attached, loadingFinished should call again
|
||||||
|
if(!this.isAttached()) return;
|
||||||
|
|
||||||
|
if(this.input != null && !this.options.tags && !this.options.search)
|
||||||
|
{
|
||||||
|
this.input.unchosen().css('width', '');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Turn on tags, if desired
|
||||||
|
if(this.input != null && (this.options.search || this.options.tags) && !this.options.disabled)
|
||||||
|
{
|
||||||
|
if(this.options.empty_label)
|
||||||
|
{
|
||||||
|
this.input.attr("data-placeholder", this.options.empty_label);
|
||||||
|
}
|
||||||
|
this.input.css("width","100%")
|
||||||
|
.chosen({
|
||||||
|
})
|
||||||
|
.change(this.onchange);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set_select_options function is added, as the select options have to be
|
* The set_select_options function is added, as the select options have to be
|
||||||
* added after the "option"-widgets were added to selectbox.
|
* added after the "option"-widgets were added to selectbox.
|
||||||
|
Loading…
Reference in New Issue
Block a user