Update for js error and template error
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 16 Mar 2017 20:43:59 +0000 (16:43 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 16 Mar 2017 20:43:59 +0000 (16:43 -0400)
Fixes for errors in the smarty template and in the js.

js/front.js

index 91b47d5..896da02 100644 (file)
@@ -31,8 +31,10 @@ jQuery(document).ready(function($){
                 return false;
             }
         }
-        var body = document.getElementById("google-div");
-        body.style.display = 'none';
+        if ($("#google-div").length > 0) {
+            var body = document.getElementById("google-div");
+            body.style.display = 'none';
+        }
         return true;
     }
 
@@ -74,9 +76,11 @@ jQuery(document).ready(function($){
     {
         try
         {
-            var body = document.getElementById("google-div");
-            body.innerHTML = '';
-            body.style.display = '';
+            if ($("#google-div").length > 0) {
+                var body = document.getElementById("google-div");
+                body.innerHTML = '';
+                body.style.display = '';
+            }
 
             var dialog = document.createElement("div");
             dialog.className = "customDialog";
@@ -123,7 +127,9 @@ jQuery(document).ready(function($){
             attachEventListener(dialogButton, "click", mySubmit, false);
             dialog.appendChild(dialogButton);
 
-            body.appendChild(dialog);
+            if ($("#google-div").length > 0) {
+                body.appendChild(dialog);
+            }
 
             var scrollingPosition = getScrollingPosition();
             var viewportSize = getViewportSize();
@@ -261,8 +267,10 @@ jQuery(document).ready(function($){
                 return false;
             }
         }
-        var body = document.getElementById("google-div");
-        body.style.display = 'none';
+        if ($("#google-div").length > 0) {
+            var body = document.getElementById("google-div");
+            body.style.display = 'none';
+        }
         return true;
     }