浏览代码

moving [x] button to the left so its easier to remove multiple sequential selections. closes #3

Igor Vaynberg 13 年之前
父节点
当前提交
339c7a850e
共有 2 个文件被更改,包括 4 次插入5 次删除
  1. 2 2
      select2.css
  2. 2 3
      select2.js

+ 2 - 2
select2.css

@@ -324,7 +324,7 @@
   color: #333;
   border: 1px solid #aaaaaa;
   line-height: 13px;
-  padding: 3px 20px 3px 5px;
+  padding: 3px 5px 3px 18px;
   margin: 3px 0 3px 5px;
   position: relative;
   cursor: default;
@@ -338,7 +338,7 @@
 .select2-search-choice-close {
   display: block;
   position: absolute;
-  right: 3px;
+  left: 3px;
   top: 4px;
   width: 12px;
   height: 13px;

+ 2 - 3
select2.js

@@ -897,6 +897,7 @@
         if (this.opened()) return;
         this.parent.open.apply(this, arguments);
         this.resizeSearch();
+        this.ensureHighlightVisible();
         this.focusSearch();
     };
 
@@ -942,7 +943,7 @@
 
         choice = $(parts.join(""));
         choice.find("a")
-            .on("click", this.bind(function (e) {
+            .on("click dblclick", this.bind(function (e) {
             this.unselect($(e.target));
             this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
             killEvent(e);
@@ -950,8 +951,6 @@
             this.focusSearch();
         })).on("focus", this.bind(function () {
             this.container.addClass("select2-container-active");
-        })).on("blur", this.bind(function () {
-            this.blur();
         }));
 
         choice.data("select2-data", data);