1
0
mirror of synced 2025-02-03 21:59:24 +03:00

Normalized select2-selecting event

This normalizes the `select2-selecting` event so the object is
returned as `choice` in the event data.  While the documentation
points to the name being `object`, all other events return the
affected data object as `choice`.

This closes the following issue: https://github.com/ivaynberg/select2/issues/2340
This commit is contained in:
Kevin Brown 2014-06-11 20:02:23 -04:00
parent b13c9b474d
commit 9e17f63013

View File

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