Skip to content

Commit a0f35ab

Browse files
committed
Remove inline styles
1 parent 4a0851b commit a0f35ab

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

select2.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,18 @@ disabled look for disabled choices in the results dropdown
628628
width: 1px;
629629
}
630630

631+
.select2-display-none {
632+
display: none;
633+
}
634+
635+
.select2-measure-scrollbar {
636+
position: absolute;
637+
top: -10000px;
638+
left: -10000px;
639+
width: 100px;
640+
height: 100px;
641+
overflow: scroll;
642+
}
631643
/* Retina-ize icons */
632644

633645
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {

select2.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ the specific language governing permissions and limitations under the Apache Lic
9696
return k >= 112 && k <= 123;
9797
}
9898
},
99-
MEASURE_SCROLLBAR_TEMPLATE = "<div style='position:absolute; top:-10000px; left:-10000px; width:100px; height:100px; overflow:scroll;'></div>";
99+
MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>";
100100

101101
$document = $(document);
102102

@@ -1628,11 +1628,11 @@ the specific language governing permissions and limitations under the Apache Lic
16281628
"class": "select2-container"
16291629
}).html([
16301630
"<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>",
1631-
" <span>&nbsp;</span><abbr class='select2-search-choice-close' style='display:none;'></abbr>",
1631+
" <span>&nbsp;</span><abbr class='select2-search-choice-close select2-display-none'></abbr>",
16321632
" <div><b></b></div>" ,
16331633
"</a>",
16341634
"<input class='select2-focusser select2-offscreen' type='text'/>",
1635-
"<div class='select2-drop' style='display:none'>" ,
1635+
"<div class='select2-drop select2-display-none'>" ,
16361636
" <div class='select2-search'>" ,
16371637
" <input type='text' autocomplete='off' class='select2-input'/>" ,
16381638
" </div>" ,
@@ -2117,7 +2117,7 @@ the specific language governing permissions and limitations under the Apache Lic
21172117
" <input type='text' autocomplete='off' class='select2-input'>" ,
21182118
" </li>" ,
21192119
"</ul>" ,
2120-
"<div class='select2-drop select2-drop-multi' style='display:none;'>" ,
2120+
"<div class='select2-drop select2-drop-multi select2-display-none'>" ,
21212121
" <ul class='select2-results'>" ,
21222122
" </ul>" ,
21232123
"</div>"].join(""));

0 commit comments

Comments
 (0)