From 69758f0b7180b322a89a0ef938cdaca36e457e5c Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 16 Jul 2012 14:10:56 +0300 Subject: [PATCH] added a little animation for removed multiselect choices --- select2.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/select2.js b/select2.js index 0eb14e6b..ed1683e7 100755 --- a/select2.js +++ b/select2.js @@ -1709,11 +1709,13 @@ .bind("click dblclick", this.bind(function (e) { if (!this.enabled) return; - this.unselect($(e.target)); - this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); + $(e.target).closest(".select2-search-choice").fadeOut('fast').animate({width: "hide"}, 50, this.bind(function(){ + this.unselect($(e.target)); + this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); + this.close(); + this.focusSearch(); + })).dequeue(); killEvent(e); - this.close(); - this.focusSearch(); })).bind("focus", this.bind(function () { if (!this.enabled) return; this.container.addClass("select2-container-active");