浏览代码

no need for style if we already have a sizer

Signed-off-by: Igor Vaynberg <[email protected]>
creage 13 年之前
父节点
当前提交
492dccd1a5
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      select2.js

+ 2 - 2
select2.js

@@ -201,9 +201,9 @@
         event.stopPropagation();
     }
 
-    function measureTextWidth(e) {
-        var style = e.currentStyle || window.getComputedStyle(e, null);
+    function measureTextWidth(e) {        
         if (!sizer){
+        	var style = e.currentStyle || window.getComputedStyle(e, null);
         	sizer = $("<div></div>").css({
 	            position: "absolute",
 	            left: "-1000px",