Skip to content

Commit

Permalink
add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
WickyNilliams committed Jan 12, 2013
1 parent 70f13fc commit d003d45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion matchMedia.addListener.js
Expand Up @@ -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 );
Expand Down Expand Up @@ -42,4 +44,4 @@
return ret;
};
}
}());
}());

0 comments on commit d003d45

Please sign in to comment.