Quellcode durchsuchen

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
Kevin Brown vor 11 Jahren
Ursprung
Commit
9e17f63013
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -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();
         },