Permalink
Browse files

indexOf for speed, methinks

  • Loading branch information...
1 parent 559dcd0 commit 83f623a0521973a476884d6b911f8251324e900e scottjehl committed Jan 17, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 respond.src.js
View
@@ -220,13 +220,14 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){
for( var i in mediastyles ){
var thisstyle = mediastyles[ i ],
min = thisstyle.minw,
- max = thisstyle.maxw;
+ max = thisstyle.maxw,
+ em = "em";
if( !!min ){
- min = parseFloat( min ) * ( /em/i.test( min ) ? ( eminpx || getEmValue() ) : 1 );
+ min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
}
if( !!max ){
- max = parseFloat( max ) * ( /em/i.test( max ) ? ( eminpx || getEmValue() ) : 1 );
+ max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
}
if(!min && !max ||

0 comments on commit 83f623a

Please sign in to comment.