small code cleanup
This commit is contained in:
parent
b30b455505
commit
eddc40934c
11
select2.js
11
select2.js
@ -772,8 +772,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
SingleSelect2.prototype.updateSelection = function (data) {
|
SingleSelect2.prototype.updateSelection = function (data) {
|
||||||
this.selection.find("span").html(this.opts.formatSelection(data));
|
this.selection
|
||||||
this.selection.removeClass("select2-default");
|
.find("span")
|
||||||
|
.html(this.opts.formatSelection(data))
|
||||||
|
.removeClass("select2-default");
|
||||||
if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
|
if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
|
||||||
this.selection.find("abbr").show();
|
this.selection.find("abbr").show();
|
||||||
}
|
}
|
||||||
@ -790,8 +792,9 @@
|
|||||||
|
|
||||||
if (this.select) {
|
if (this.select) {
|
||||||
// val is an id
|
// val is an id
|
||||||
this.select.val(val);
|
this.select
|
||||||
this.select.find(":selected").each(function () {
|
.val(val)
|
||||||
|
.find(":selected").each(function () {
|
||||||
data = {id: $(this).attr("value"), text: $(this).text()};
|
data = {id: $(this).attr("value"), text: $(this).text()};
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user