From cad98c8251bd09e41dde6ec0105d5f85ee4f94ef Mon Sep 17 00:00:00 2001 From: Daniel-dlev1 Date: Wed, 13 Aug 2014 11:04:28 -0400 Subject: [PATCH] Call "unmatch" callback upon "addHandler" Call "unmatch" callback inside "addHandler" if the query doesn't match. --- src/MediaQuery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MediaQuery.js b/src/MediaQuery.js index 987969c..734f91c 100644 --- a/src/MediaQuery.js +++ b/src/MediaQuery.js @@ -33,7 +33,7 @@ var qh = new QueryHandler(handler); this.handlers.push(qh); - this.matches() && qh.on(); + this.matches() && qh.on() || qh.off(); }, /** @@ -81,4 +81,4 @@ handler[action](); }); } - }; \ No newline at end of file + };