This repository was archived by the owner on Jul 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ License: MIT License (see homepage)
24
24
REGEXP = RegExp ,
25
25
DOCUMENT = document ,
26
26
WINDOW = window ,
27
- SCREEN = screen ,
28
27
LOCATION = WINDOW . location . href ,
29
28
EMPTY_FN = function ( ) { } ,
30
29
@@ -2488,7 +2487,7 @@ License: MIT License (see homepage)
2488
2487
function convertToPixels ( val )
2489
2488
{
2490
2489
var
2491
- number = parseInt ( val . replace ( / [ ^ \d ] + / g , '' ) , 10 ) ,
2490
+ number = parseInt ( val , 10 ) ,
2492
2491
unit = val . replace ( number , '' ) ;
2493
2492
switch ( unit ) {
2494
2493
case PX :
@@ -2524,7 +2523,7 @@ License: MIT License (see homepage)
2524
2523
{
2525
2524
getHeight = function ( )
2526
2525
{
2527
- return document . documentElement . clientHeight ;
2526
+ return DOCUMENT . documentElement . clientHeight ;
2528
2527
} ;
2529
2528
}
2530
2529
else
@@ -2559,9 +2558,9 @@ License: MIT License (see homepage)
2559
2558
matches = TRUE ; // optimism
2560
2559
mediaQueryRegex = newRegExp ( REGEXP_MQ_PARENS ) ;
2561
2560
W = getWidth ( ) ;
2562
- DW = SCREEN . width ;
2561
+ DW = screen . width ;
2563
2562
H = getHeight ( ) ;
2564
- DH = SCREEN . height ;
2563
+ DH = screen . height ;
2565
2564
i = queries . length ;
2566
2565
while ( i -- )
2567
2566
{
Original file line number Diff line number Diff line change @@ -178,12 +178,20 @@ eCSStender.onComplete(function(){
178
178
matches = eCSStender . lookup ( { 'selector' :'#bar' } , '*' ) ;
179
179
ok ( matches . length === 0 , 'array of css files ignored' ) ;
180
180
} ) ;
181
+
181
182
module ( 'Media Queries' ) ;
182
- test ( 'eCSStender::matchMedia' , function ( ) {
183
+ test ( 'eCSStender::matchMedia' , function ( )
184
+ {
183
185
ok ( typeof ( eCSStender . matchMedia ) == 'function' , 'eCSStender::matchMedia() exists' ) ;
184
- if ( typeof ( window . matchMedia ) != 'undefined' && false ) {
186
+ if ( typeof ( window . matchMedia ) == 'undefined' )
187
+ {
188
+ ok ( true , 'window.matchMedia does not exist, these tests are using the eCSStender method' ) ;
189
+ }
190
+ else
191
+ {
185
192
ok ( true , 'window.matchMedia exists, these tests are using the native method' ) ;
186
193
}
194
+
187
195
var
188
196
W = $ ( window ) . width ( ) ,
189
197
H = $ ( window ) . height ( ) ,
You can’t perform that action at this time.
0 commit comments