Skip to content

Commit b095900

Browse files
committed
namespace events and consoldate select and selected into selecting. fixes select2#497. fixes select2#1262
1 parent 266861a commit b095900

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

select2.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ the specific language governing permissions and limitations under the Apache Lic
998998

999999
// abstract
10001000
triggerSelect: function(data) {
1001-
var evt = $.Event("selected", { val: this.id(data), object: data });
1001+
var evt = $.Event("select2-selecting", { val: this.id(data), object: data });
10021002
this.opts.element.trigger(evt);
10031003
return !evt.isDefaultPrevented();
10041004
},
@@ -1157,7 +1157,7 @@ the specific language governing permissions and limitations under the Apache Lic
11571157

11581158
if (this.opened()) return false;
11591159

1160-
event = $.Event("opening");
1160+
event = $.Event("select2-opening");
11611161
this.opts.element.trigger(event);
11621162
return !event.isDefaultPrevented();
11631163
},
@@ -1282,7 +1282,7 @@ the specific language governing permissions and limitations under the Apache Lic
12821282

12831283
this.clearSearch();
12841284
this.search.removeClass("select2-active");
1285-
this.opts.element.trigger($.Event("close"));
1285+
this.opts.element.trigger($.Event("select2-close"));
12861286
},
12871287

12881288
// abstract
@@ -1381,7 +1381,7 @@ the specific language governing permissions and limitations under the Apache Lic
13811381

13821382
data = choice.data("select2-data");
13831383
if (data) {
1384-
this.opts.element.trigger({ type: "highlight", val: this.id(data), choice: data });
1384+
this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
13851385
}
13861386
},
13871387

@@ -1576,7 +1576,7 @@ the specific language governing permissions and limitations under the Apache Lic
15761576

15771577
postRender();
15781578

1579-
this.opts.element.trigger({ type: "loaded", data:data });
1579+
this.opts.element.trigger({ type: "select2-loaded", data:data });
15801580
})});
15811581
},
15821582

@@ -1716,7 +1716,7 @@ the specific language governing permissions and limitations under the Apache Lic
17161716
this.search.focus();
17171717
this.focusser.prop("disabled", true).val("");
17181718
this.updateResults(true);
1719-
this.opts.element.trigger($.Event("open"));
1719+
this.opts.element.trigger($.Event("select2-open"));
17201720
},
17211721

17221722
// single
@@ -1898,7 +1898,7 @@ the specific language governing permissions and limitations under the Apache Lic
18981898
this.setPlaceholder();
18991899

19001900
if (triggerChange !== false){
1901-
this.opts.element.trigger({ type: "removed", val: this.id(data), choice: data });
1901+
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
19021902
this.triggerChange({removed:data});
19031903
}
19041904
}
@@ -2040,7 +2040,7 @@ the specific language governing permissions and limitations under the Apache Lic
20402040
this.opts.element.val(this.id(data));
20412041
this.updateSelection(data);
20422042

2043-
this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
2043+
this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
20442044

20452045
this.close();
20462046

0 commit comments

Comments
 (0)