simplify query match
authorHakim El Hattab <hakim.elhattab@gmail.com>
Wed, 4 Jul 2012 18:42:27 +0000 (14:42 -0400)
committerHakim El Hattab <hakim.elhattab@gmail.com>
Wed, 4 Jul 2012 18:42:27 +0000 (14:42 -0400)
lib/slidenotes/client.js

index f594fb6293eed56c8e04bd84a6d6b12ec3c804f7..1aba8b8c29837fb5780ff538958bce0583714478 100644 (file)
@@ -1,7 +1,6 @@
 (function() {
        // don't emit events from inside the previews themselves
-       var qs = window.location.href.split('?');
-       if (qs.length > 1 && qs[1].match('receiver')) { return; }
+       if ( window.location.search.match( /receiver/gi ) ) { return; }
 
        var socket = io.connect(window.location.origin);
        var socketId = Math.random().toString().slice(2);