1
0
mirror of synced 2025-02-09 16:49:24 +03:00

Unselected item is returned as options only if event isn't prevented

This commit is contained in:
Ján Koščo 2014-03-05 10:55:42 +01:00
parent ec97c818c8
commit 2059b5d4d3

View File

@ -2988,12 +2988,6 @@ the specific language governing permissions and limitations under the Apache Lic
return;
}
while((index = indexOf(this.id(data), val)) >= 0) {
val.splice(index, 1);
this.setVal(val);
if (this.select) this.postprocessResults();
}
var evt = $.Event("select2-removing");
evt.val = this.id(data);
evt.choice = data;
@ -3003,6 +2997,12 @@ the specific language governing permissions and limitations under the Apache Lic
return;
}
while((index = indexOf(this.id(data), val)) >= 0) {
val.splice(index, 1);
this.setVal(val);
if (this.select) this.postprocessResults();
}
selected.remove();
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });