testing date picker fix for the off canvas reservation widget
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 13 Aug 2018 20:41:37 +0000 (16:41 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 13 Aug 2018 20:41:37 +0000 (16:41 -0400)
js/app.js
js/custom/pageSetup.js
parts/reservation-form-off-canvas.php

index ac56d62..e3a4eb1 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -33,12 +33,12 @@ $(document).ready(function () {
         kids,
         perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&';
 
-    ///////off canvas date picker logic //////////////////////////////////////////////
-    // Set inputs to default values ///////
-    $("#propertyNameOff").val("");
-    $("#nightsOff").val("");
-    $("#adultsOff").val("");
-    $("#kidsOff").val("");
+    // ///////off canvas date picker logic //////////////////////////////////////////////
+    // // Set inputs to default values ///////
+    // $("#propertyNameOff").val("");
+    // $("#nightsOff").val("");
+    // $("#adultsOff").val("");
+    // $("#kidsOff").val("");
 
     $(document).on('change', '#arriveOff', function () {
 
@@ -77,11 +77,11 @@ $(document).ready(function () {
             $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
         }
         if ($("#nightsOff").val() <= 0) {
-            $("#departOff").val("Minimum 1 Night");
+            // $("#departOff").val("Minimum 1 Night");
             $("#nightsOff").val("");
         }
     });
-    // restrict departure date ///////////////////////////////
+    // // restrict departure date ///////////////////////////////
     $(document).on('change', '#departOff', function () {
         currentDate2 = $("#departOff").val();
         currentDate2 = new Date(currentDate2);
@@ -89,13 +89,13 @@ $(document).ready(function () {
         currentDate2.setDate(currentDate2.getDate());
         $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
         if ($("#nightsOff").val() <= 0) {
-            $("#departOff").val("Minimum 1 Night");
+            // $("#departOff").val("Minimum 1 Night");
             $("#nightsOff").val("");
         }
         stay = 'stay_nights=' + $('#nightsOff').val() + '&';
     });
-    ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
-    /// top bar reservation form dropdown logic ////////////////////////////
+    // ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
+    // /// top bar reservation form dropdown logic ////////////////////////////
     $("#arrive").datepicker({
         minDate: 0,
         dateFormat: 'mm/dd/yy',
@@ -143,22 +143,23 @@ $(document).ready(function () {
     $("#departCalOff").click(function () {
         $("#departOff").datepicker("show");
     });
-    // form submission logic
-    // off canvas resevation form submission ///////////////////////////////////////////
+    // // form submission logic
+    // // off canvas resevation form submission ///////////////////////////////////////////
     $('.res-buttonOff').on('click', function () {
+        console.log($('#propertyNameOff option:selected').text())
         adults = "adults=" + $("#adultsOff").val() + "&";
         kids = "children=" + $("#kidsOff").val();
-        if ($('#propertyNameOff option:selected').text() === "Bay View Inn") {
+        if ($('#propertyNameOff option:selected').text() === " Bay View Inn") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids);
-        } else if ($('#propertyNameOff option:selected').text() === "Crooked River Lodge") {
+        } else if ($('#propertyNameOff option:selected').text() === " Crooked River Lodge") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids);
-        } else if ($('#propertyNameOff option:selected').text() === "Perry Hotel") {
+        } else if ($('#propertyNameOff option:selected').text() === " Perry Hotel") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids);
         } else if ($('#propertyName option:selected').text() === "Property") {
             alert("Please Select a Property");
         }
     });
-    // top bar reservation dropdown button submission //////////////////////////////////////////
+    // // top bar reservation dropdown button submission //////////////////////////////////////////
     $('.res-button').on('click', function () {
         adults = "adults=" + $("#adults").val() + "&";
         kids = "children=" + $("#kids").val();
index 79bec87..05b5543 100644 (file)
@@ -24,12 +24,12 @@ $(document).ready(function () {
         kids,
         perry = 'RtXm7mjas4tWRxEAkt8ienQMPRR5EbsZGSOalE8V63s%3d&';
 
-    ///////off canvas date picker logic //////////////////////////////////////////////
-    // Set inputs to default values ///////
-    $("#propertyNameOff").val("");
-    $("#nightsOff").val("");
-    $("#adultsOff").val("");
-    $("#kidsOff").val("");
+    // ///////off canvas date picker logic //////////////////////////////////////////////
+    // // Set inputs to default values ///////
+    // $("#propertyNameOff").val("");
+    // $("#nightsOff").val("");
+    // $("#adultsOff").val("");
+    // $("#kidsOff").val("");
 
     $(document).on('change', '#arriveOff', function () {
 
@@ -68,11 +68,11 @@ $(document).ready(function () {
             $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
         }
         if ($("#nightsOff").val() <= 0) {
-            $("#departOff").val("Minimum 1 Night");
+            // $("#departOff").val("Minimum 1 Night");
             $("#nightsOff").val("");
         }
     });
-    // restrict departure date ///////////////////////////////
+    // // restrict departure date ///////////////////////////////
     $(document).on('change', '#departOff', function () {
         currentDate2 = $("#departOff").val();
         currentDate2 = new Date(currentDate2);
@@ -80,13 +80,13 @@ $(document).ready(function () {
         currentDate2.setDate(currentDate2.getDate());
         $("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
         if ($("#nightsOff").val() <= 0) {
-            $("#departOff").val("Minimum 1 Night");
+            // $("#departOff").val("Minimum 1 Night");
             $("#nightsOff").val("");
         }
         stay = 'stay_nights=' + $('#nightsOff').val() + '&';
     });
-    ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
-    /// top bar reservation form dropdown logic ////////////////////////////
+    // ///// end of canvas datepicker logic ^ //////////////////////////////////////////////
+    // /// top bar reservation form dropdown logic ////////////////////////////
     $("#arrive").datepicker({
         minDate: 0,
         dateFormat: 'mm/dd/yy',
@@ -134,22 +134,23 @@ $(document).ready(function () {
     $("#departCalOff").click(function () {
         $("#departOff").datepicker("show");
     });
-    // form submission logic
-    // off canvas resevation form submission ///////////////////////////////////////////
+    // // form submission logic
+    // // off canvas resevation form submission ///////////////////////////////////////////
     $('.res-buttonOff').on('click', function () {
+        console.log($('#propertyNameOff option:selected').text())
         adults = "adults=" + $("#adultsOff").val() + "&";
         kids = "children=" + $("#kidsOff").val();
-        if ($('#propertyNameOff option:selected').text() === "Bay View Inn") {
+        if ($('#propertyNameOff option:selected').text() === " Bay View Inn") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids);
-        } else if ($('#propertyNameOff option:selected').text() === "Crooked River Lodge") {
+        } else if ($('#propertyNameOff option:selected').text() === " Crooked River Lodge") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids);
-        } else if ($('#propertyNameOff option:selected').text() === "Perry Hotel") {
+        } else if ($('#propertyNameOff option:selected').text() === " Perry Hotel") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids);
         } else if ($('#propertyName option:selected').text() === "Property") {
             alert("Please Select a Property");
         }
     });
-    // top bar reservation dropdown button submission //////////////////////////////////////////
+    // // top bar reservation dropdown button submission //////////////////////////////////////////
     $('.res-button').on('click', function () {
         adults = "adults=" + $("#adults").val() + "&";
         kids = "children=" + $("#kids").val();
index 4941735..0a09aff 100644 (file)
@@ -1,4 +1,5 @@
-<?php global $post; 
+<?php 
+global $post; 
 $oc_properties = array(
     187 => "Stafford's Bay View Inn",
     188 => "Stafford's Crooked River Lodge",
@@ -9,13 +10,13 @@ $oc_properties = array(
         <div class="row">
             <div class="small-12 res-search columns">
                 <select id="propertyNameOff" name="s">
-                    <option value="">Property</option>
-                    <?php foreach($oc_properties as $id=>$property){ 
-                        $short_name = str_replace("Stafford's", "", $property);
-                        if( $oc_ancestorProperty == $property){ ?>
-                            <option value="<?php echo $property; ?>" selected><?php echo $short_name; ?></option>
+                    <option value="" selected disabled>Property</option>
+                    <?php foreach($oc_properties as $id=>$oc_property){ 
+                        $short_name = str_replace("Stafford's", "", $oc_property);
+                        if( $oc_ancestorProperty == $oc_property){ ?>
+                            <option value="<?php echo $oc_property; ?>" selected><?php echo $short_name; ?></option>
                         <?php } else { ?>
-                            <option value="<?php echo $property ;?>"><?php echo $short_name; ?></option>
+                            <option value="<?php echo $oc_property ;?>"><?php echo $short_name; ?></option>
                         <?php }  ?>
                     <?php } ?>
                 </select>