From cd8347c58d69d40f43c4a8ecb78e1c883fe42c50 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 27 Oct 2015 13:31:19 -0400 Subject: [PATCH] Remove featured image from reservation page and adjust iframe width --- js/app.js | 12 ++++++++++-- js/custom/pageSetup.js | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index d6988ae..0b6c347 100644 --- 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")); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index c4dfb84..fe6f526 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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")); -- 2.17.1