Remove featured image from reservation page and adjust iframe width
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 27 Oct 2015 17:31:19 +0000 (13:31 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 27 Oct 2015 17:31:19 +0000 (13:31 -0400)
js/app.js
js/custom/pageSetup.js

index d6988ae..0b6c347 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -31,23 +31,30 @@ $(document).ready(function () {
         console.log('ul = ' + menuImg);
         console.log('menu-id = ' + menuNum);
     });
+    //// Reservation Form logic /////////////////////////////
+    
+    // get the url to determine the page location
     page = $(location).attr('pathname');
  
+    // if current page is NOT reservation change submit to regular button to nav to reservation page
     if (page.indexOf("reservation") <= 0) {
         $("#resBtn").prop("type", 'button');
         $("#resBtn").prop("id", "btn");
     }
+    // remove featured image from reservation page and trigger form submission to iframe
     if (page.indexOf("reservation") >= 0) {
+        $("#head-img").remove();
         $(document).ready(function () {
             $("#resBtn").trigger("click");
         });
     }
-   
+    
+    // navigate to reservation page
     $('#btn').click(function () {
         window.location.href = "reservation";
-        
     });
     
+    // save guest input
     $('#guests').blur(function () {
         guests = $('#guests').val();
         sessionStorage.setItem("guests", guests);
@@ -67,6 +74,7 @@ $(document).ready(function () {
             sessionStorage.setItem("departure", departure);
         }
     });
+    // restore input values after page reload. sessionStorage will delete values if tab or window is closed
     $("#date1").val(sessionStorage.getItem("arrival"));
     $("#date2").val(sessionStorage.getItem("departure"));
     $('#guests').val(sessionStorage.getItem("guests"));
index c4dfb84..fe6f526 100644 (file)
@@ -22,23 +22,30 @@ $(document).ready(function () {
         console.log('ul = ' + menuImg);
         console.log('menu-id = ' + menuNum);
     });
+    //// Reservation Form logic /////////////////////////////
+    
+    // get the url to determine the page location
     page = $(location).attr('pathname');
  
+    // if current page is NOT reservation change submit to regular button to nav to reservation page
     if (page.indexOf("reservation") <= 0) {
         $("#resBtn").prop("type", 'button');
         $("#resBtn").prop("id", "btn");
     }
+    // remove featured image from reservation page and trigger form submission to iframe
     if (page.indexOf("reservation") >= 0) {
+        $("#head-img").remove();
         $(document).ready(function () {
             $("#resBtn").trigger("click");
         });
     }
-   
+    
+    // navigate to reservation page
     $('#btn').click(function () {
         window.location.href = "reservation";
-        
     });
     
+    // save guest input
     $('#guests').blur(function () {
         guests = $('#guests').val();
         sessionStorage.setItem("guests", guests);
@@ -58,6 +65,7 @@ $(document).ready(function () {
             sessionStorage.setItem("departure", departure);
         }
     });
+    // restore input values after page reload. sessionStorage will delete values if tab or window is closed
     $("#date1").val(sessionStorage.getItem("arrival"));
     $("#date2").val(sessionStorage.getItem("departure"));
     $('#guests').val(sessionStorage.getItem("guests"));