1
0
mirror of synced 2025-02-04 06:09:23 +03:00

Merge pull request #1774 from avelis/master

Fix for #1518. Update to select2.js to trigger properly named event.
This commit is contained in:
Igor Vaynberg 2013-10-08 20:35:55 -07:00
commit 58f939ef3b

View File

@ -2883,9 +2883,17 @@ the specific language governing permissions and limitations under the Apache Lic
this.setVal(val);
if (this.select) this.postprocessResults();
}
selected.remove();
this.opts.element.trigger({ type: "removed", val: this.id(data), choice: data });
var evt = $.Event("select2-removing");
evt.val = this.id(data);
evt.choice = data;
this.opts.element.trigger(evt);
if (evt.isDefaultPrevented()) {
return;
}
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
this.triggerChange({ removed: data });
},