fixing js error
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 30 May 2018 20:10:55 +0000 (16:10 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 30 May 2018 20:10:55 +0000 (16:10 -0400)
assets/js/glm-dev.js
glm-dev/js/glm-dev.js

index 091e6b8..cc6e028 100644 (file)
@@ -1 +1 @@
-jQuery(function(e){e(window).on("load",function(){function t(e){document.getElementById("jp_audio_0").pause(),setTimeout(function(){document.getElementById("jp_audio_0").play()},1e4);e[0].target.src}e(".jp-interface").appendTo(e(".title_image_wrapper")),e(".jp-interface").each(function(){this.style.setProperty("display","block","important")}),new MutationObserver(t).observe(document.getElementById("jp_audio_0"),{attributes:!0,attributeFilter:["src"]})})});
\ No newline at end of file
+jQuery(function(e){e(window).on("load",function(){function t(e){document.getElementById("jp_audio_0").pause(),setTimeout(function(){document.getElementById("jp_audio_0").play()},1e4);e[0].target.src}if(e(".jp-interface").appendTo(e(".title_image_wrapper")),e(".jp-interface").each(function(){this.style.setProperty("display","block","important")}),e("#jp_audio_0").length>0){new MutationObserver(t).observe(document.getElementById("jp_audio_0"),{attributes:!0,attributeFilter:["src"]})}})});
\ No newline at end of file
index 3182f1e..4781efb 100644 (file)
@@ -6,18 +6,20 @@ jQuery(function($){
             this.style.setProperty( 'display', 'block', 'important' );
         })
     
-        var observer = new MutationObserver(urlChanged);
-        observer.observe(document.getElementById('jp_audio_0'), {
-            attributes: true,
-            attributeFilter: ['src'],
-        });
-        
-        function urlChanged(mutations) {
-            document.getElementById('jp_audio_0').pause()
-            setTimeout(function(){
-                document.getElementById('jp_audio_0').play()
-            }, 10000)
-            var newUrl = mutations[0].target.src;
+        if($("#jp_audio_0").length > 0){
+            var observer = new MutationObserver(urlChanged);
+            observer.observe(document.getElementById('jp_audio_0'), {
+                attributes: true,
+                attributeFilter: ['src'],
+            });
+            
+            function urlChanged(mutations) {
+                document.getElementById('jp_audio_0').pause()
+                setTimeout(function(){
+                    document.getElementById('jp_audio_0').play()
+                }, 10000)
+                var newUrl = mutations[0].target.src;
+            }
         }
     });
 });
\ No newline at end of file