File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1121,9 +1121,7 @@ the specific language governing permissions and limitations under the Apache Lic
11211121 this . dropdown . attr ( "id" , "select2-drop" ) ;
11221122
11231123 // show the elements
1124- mask . css ( {
1125- width : document . documentElement . scrollWidth ,
1126- height : document . documentElement . scrollHeight } ) ;
1124+ mask . css ( _makeMaskCss ( ) ) ;
11271125 mask . show ( ) ;
11281126 this . dropdown . show ( ) ;
11291127 this . positionDropdown ( ) ;
@@ -1136,14 +1134,19 @@ the specific language governing permissions and limitations under the Apache Lic
11361134 var that = this ;
11371135 this . container . parents ( ) . add ( window ) . each ( function ( ) {
11381136 $ ( this ) . bind ( resize + " " + scroll + " " + orient , function ( e ) {
1139- $ ( "#select2-drop-mask" ) . css ( {
1140- width :document . documentElement . scrollWidth ,
1141- height :document . documentElement . scrollHeight } ) ;
1137+ $ ( "#select2-drop-mask" ) . css ( _makeMaskCss ( ) ) ;
11421138 that . positionDropdown ( ) ;
11431139 } ) ;
11441140 } ) ;
11451141
11461142 this . focusSearch ( ) ;
1143+
1144+ function _makeMaskCss ( ) {
1145+ return {
1146+ width : Math . max ( document . documentElement . scrollWidth , $ ( window ) . width ( ) ) ,
1147+ height : Math . max ( document . documentElement . scrollHeight , $ ( window ) . height ( ) )
1148+ }
1149+ }
11471150 } ,
11481151
11491152 // abstract
You can’t perform that action at this time.
0 commit comments