Skip to content

Commit eddc409

Browse files
committed
small code cleanup
1 parent b30b455 commit eddc409

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

select2.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,10 @@
772772
};
773773

774774
SingleSelect2.prototype.updateSelection = function (data) {
775-
this.selection.find("span").html(this.opts.formatSelection(data));
776-
this.selection.removeClass("select2-default");
775+
this.selection
776+
.find("span")
777+
.html(this.opts.formatSelection(data))
778+
.removeClass("select2-default");
777779
if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
778780
this.selection.find("abbr").show();
779781
}
@@ -790,11 +792,12 @@
790792

791793
if (this.select) {
792794
// val is an id
793-
this.select.val(val);
794-
this.select.find(":selected").each(function () {
795-
data = {id: $(this).attr("value"), text: $(this).text()};
796-
return false;
797-
});
795+
this.select
796+
.val(val)
797+
.find(":selected").each(function () {
798+
data = {id: $(this).attr("value"), text: $(this).text()};
799+
return false;
800+
});
798801
this.updateSelection(data);
799802
} else {
800803
// val is an object

0 commit comments

Comments
 (0)