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

+ 6 - 1
select2.css

@@ -99,7 +99,7 @@ Version: @@ver@@ Timestamp: @@timestamp@@
 }
 
 .select2-container .select2-choice abbr {
-    display: inline-block;
+    display: none;
     width: 12px;
     height: 12px;
     position: absolute;
@@ -114,6 +114,11 @@ Version: @@ver@@ Timestamp: @@timestamp@@
     cursor: pointer;
     outline: 0;
 }
+
+.select2-container.select2-allowclear .select2-choice abbr {
+    display: inline-block;
+}
+
 .select2-container .select2-choice abbr:hover {
     background-position: right -11px;
     cursor: pointer;

+ 1 - 3
select2.js

@@ -1693,7 +1693,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 "class": "select2-container"
             }).html([
                 "<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>",
-                "   <span>&nbsp;</span><abbr class='select2-search-choice-close select2-display-none'></abbr>",
+                "   <span>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>",
                 "   <div><b></b></div>" ,
                 "</a>",
                 "<input class='select2-focusser select2-offscreen' type='text'/>",
@@ -2005,7 +2005,6 @@ the specific language governing permissions and limitations under the Apache Lic
                 this.selection.addClass("select2-default");
 
                 this.container.removeClass("select2-allowclear");
-                this.selection.find("abbr").hide();
             }
         },
 
@@ -2084,7 +2083,6 @@ the specific language governing permissions and limitations under the Apache Lic
 
             if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
                 this.container.addClass("select2-allowclear");
-                this.selection.find("abbr").show();
             }
         },