Skip to content

Commit

Permalink
Little bit more flexible syntax in MQ allows white-space between open…
Browse files Browse the repository at this point in the history
…ing ( and min/max-width. White-space was already allowed prior to ending ).
  • Loading branch information
zachleat committed Apr 11, 2013
1 parent 1aa5f5f commit 7f3463f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions respond.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ window.matchMedia = window.matchMedia || (function( doc, undefined ) {
media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all",
rules : rules.length - 1,
hasquery : thisq.indexOf("(") > -1,
minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
minw : thisq.match( /\(\s*min\-width:\s*(\s*[0-9\.]+)(px|em)\s*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
maxw : thisq.match( /\(\s*max\-width:\s*(\s*[0-9\.]+)(px|em)\s*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
} );
}
}
Expand Down

0 comments on commit 7f3463f

Please sign in to comment.