瀏覽代碼

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 11 年之前
父節點
當前提交
9e17f63013
共有 1 個文件被更改,包括 1 次插入1 次删除
  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();
         },