Преглед на файлове

added a little animation for removed multiselect choices

Igor Vaynberg преди 13 години
родител
ревизия
69758f0b71
променени са 1 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 6 4
      select2.js

+ 6 - 4
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");