Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add explanatory comment

  • Loading branch information...
commit d003d4511bc57e0e756c3d60c7de306b2632a47d 1 parent 70f13fc
@WickyNilliams WickyNilliams authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 matchMedia.addListener.js
View
4 matchMedia.addListener.js
@@ -13,6 +13,8 @@
var list = oldMM( q ),
unmatchToMatch = list.matches && !last,
matchToUnmatch = !list.matches && last;
+
+ //fire callbacks only if transitioning to or from matched state
if( unmatchToMatch || matchToUnmatch ){
for( var i =0, il = listeners.length; i< il; i++ ){
listeners[ i ].call( ret, list );
@@ -42,4 +44,4 @@
return ret;
};
}
-}());
+}());
Please sign in to comment.
Something went wrong with that request. Please try again.