Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Commit 48eed35

Browse files
updating tests & fixing issue with minification
1 parent 36fb18d commit 48eed35

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/eCSStender.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ License: MIT License (see homepage)
2424
REGEXP = RegExp,
2525
DOCUMENT = document,
2626
WINDOW = window,
27-
SCREEN = screen,
2827
LOCATION = WINDOW.location.href,
2928
EMPTY_FN = function(){},
3029

@@ -2488,7 +2487,7 @@ License: MIT License (see homepage)
24882487
function convertToPixels( val )
24892488
{
24902489
var
2491-
number = parseInt(val.replace(/[^\d]+/g, ''), 10),
2490+
number = parseInt(val, 10),
24922491
unit = val.replace(number, '');
24932492
switch(unit) {
24942493
case PX:
@@ -2524,7 +2523,7 @@ License: MIT License (see homepage)
25242523
{
25252524
getHeight = function()
25262525
{
2527-
return document.documentElement.clientHeight;
2526+
return DOCUMENT.documentElement.clientHeight;
25282527
};
25292528
}
25302529
else
@@ -2559,9 +2558,9 @@ License: MIT License (see homepage)
25592558
matches = TRUE; // optimism
25602559
mediaQueryRegex = newRegExp(REGEXP_MQ_PARENS);
25612560
W = getWidth();
2562-
DW = SCREEN.width;
2561+
DW = screen.width;
25632562
H = getHeight();
2564-
DH = SCREEN.height;
2563+
DH = screen.height;
25652564
i = queries.length;
25662565
while ( i-- )
25672566
{

tests/js/core.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,20 @@ eCSStender.onComplete(function(){
178178
matches = eCSStender.lookup({'selector':'#bar'},'*');
179179
ok( matches.length===0, 'array of css files ignored' );
180180
});
181+
181182
module('Media Queries');
182-
test( 'eCSStender::matchMedia', function(){
183+
test( 'eCSStender::matchMedia', function()
184+
{
183185
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+
{
185192
ok(true, 'window.matchMedia exists, these tests are using the native method');
186193
}
194+
187195
var
188196
W = $(window).width(),
189197
H = $(window).height(),

0 commit comments

Comments
 (0)