removing jquery datepicker and using native booking widget datepicker by removing...
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jul 2016 12:26:39 +0000 (08:26 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jul 2016 12:26:39 +0000 (08:26 -0400)
js/app.js
js/custom/pageSetup.js
parts/reservation-form-content.php

index 1ed6a69..db3bffd 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -70,12 +70,12 @@ $(document).ready(function () {
      var off_canvas_arrival = $(".right-off-canvas-menu").find("#start-date");
      var off_canvas_departure = $(".right-off-canvas-menu").find("#end-date");
     
-     $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
-     $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
+//     $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
+//     $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
     
-      $(off_canvas_arrival).datepicker({
+//      $(off_canvas_arrival).datepicker({
 
-          minDate: 0,
+//          minDate: 0,
 //          beforeShow: function (input, inst) {
 //            setTimeout(function () {
 //            inst.dpDiv.css({
@@ -84,29 +84,29 @@ $(document).ready(function () {
 //            });
 //            }, 0);
 //        }
-      });
+//      });
     
       
        var depart_min, min_date, y, m, d;
-      $(off_canvas_arrival).change( function () {
-          
-            min_date = $(this).datepicker('getDate', '+1d');
-            min_date.setDate(min_date.getDate() + 1);
+//      $(off_canvas_arrival).change( function () {
+//          
+//            min_date = $(this).datepicker('getDate', '+1d');
+//            min_date.setDate(min_date.getDate() + 1);
 
 //            $(off_canvas_departure).datepicker('setDate', min_date);
-            $(off_canvas_departure).datepicker('option','minDate', min_date );
-   
-       });
-            $(off_canvas_departure).datepicker({
-//              beforeShow: function (input, inst) {
-//              setTimeout(function () {
-//                inst.dpDiv.css({
-//                    top: 100,
-//                    left: 50 
-//                });
-//                }, 0);
-//             }
-          });
+//            $(off_canvas_departure).datepicker('option','minDate', min_date );
+//   
+//       });
+//            $(off_canvas_departure).datepicker({
+////              beforeShow: function (input, inst) {
+////              setTimeout(function () {
+////                inst.dpDiv.css({
+////                    top: 100,
+////                    left: 50 
+////                });
+////                }, 0);
+////             }
+//          });
     
 
     
@@ -126,21 +126,33 @@ $(document).ready(function () {
     
     
     // this section is to remove duplicate ID's preventing datepicker from working
+    var start_datepicker_large = $("#resContent").find("#start-jrdatepicker");
+    var end_datepicker_large = $("#resContent").find("#end-jrdatepicker");
+    
     if ($(window).width() < 1024) {
         $(start_date).attr("id", "none")
         $(end_date).attr("id", "none");
+        $(start_datepicker_large).attr("id", "none");
+        $(end_datepicker_large).attr("id", "none");
+        
     } else {
         $(start_date).attr("id", "start-date")
         $(end_date).attr("id", "end-date");
+        $(start_datepicker_large).attr("id", "start-jrdatepicker");
+        $(end_datepicker_large).attr("id", "end-jrdatepicker");
     }
     $(window).resize( function () { 
         if ($(window).width() < 1024) {
            $(start_date).attr("id", "none");
            $(end_date).attr("id", "none");
+           $(start_datepicker_large).attr("id", "none");
+           $(end_datepicker_large).attr("id", "none");
             
         } else {
            $(start_date).attr("id", "start-date");
            $(end_date).attr("id", "end-date");
+            $(start_datepicker_large).attr("id", "start-jrdatepicker");
+            $(end_datepicker_large).attr("id", "end-jrdatepicker");
         }
     });
     
index fe8471f..2e4d710 100644 (file)
@@ -61,12 +61,12 @@ $(document).ready(function () {
      var off_canvas_arrival = $(".right-off-canvas-menu").find("#start-date");
      var off_canvas_departure = $(".right-off-canvas-menu").find("#end-date");
     
-     $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
-     $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
+//     $(off_canvas_arrival).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
+//     $(off_canvas_departure).removeClass("date-pick").removeAttr("onclick").removeAttr("value");
     
-      $(off_canvas_arrival).datepicker({
+//      $(off_canvas_arrival).datepicker({
 
-          minDate: 0,
+//          minDate: 0,
 //          beforeShow: function (input, inst) {
 //            setTimeout(function () {
 //            inst.dpDiv.css({
@@ -75,29 +75,29 @@ $(document).ready(function () {
 //            });
 //            }, 0);
 //        }
-      });
+//      });
     
       
        var depart_min, min_date, y, m, d;
-      $(off_canvas_arrival).change( function () {
-          
-            min_date = $(this).datepicker('getDate', '+1d');
-            min_date.setDate(min_date.getDate() + 1);
+//      $(off_canvas_arrival).change( function () {
+//          
+//            min_date = $(this).datepicker('getDate', '+1d');
+//            min_date.setDate(min_date.getDate() + 1);
 
 //            $(off_canvas_departure).datepicker('setDate', min_date);
-            $(off_canvas_departure).datepicker('option','minDate', min_date );
-   
-       });
-            $(off_canvas_departure).datepicker({
-//              beforeShow: function (input, inst) {
-//              setTimeout(function () {
-//                inst.dpDiv.css({
-//                    top: 100,
-//                    left: 50 
-//                });
-//                }, 0);
-//             }
-          });
+//            $(off_canvas_departure).datepicker('option','minDate', min_date );
+//   
+//       });
+//            $(off_canvas_departure).datepicker({
+////              beforeShow: function (input, inst) {
+////              setTimeout(function () {
+////                inst.dpDiv.css({
+////                    top: 100,
+////                    left: 50 
+////                });
+////                }, 0);
+////             }
+//          });
     
 
     
@@ -117,21 +117,33 @@ $(document).ready(function () {
     
     
     // this section is to remove duplicate ID's preventing datepicker from working
+    var start_datepicker_large = $("#resContent").find("#start-jrdatepicker");
+    var end_datepicker_large = $("#resContent").find("#end-jrdatepicker");
+    
     if ($(window).width() < 1024) {
         $(start_date).attr("id", "none")
         $(end_date).attr("id", "none");
+        $(start_datepicker_large).attr("id", "none");
+        $(end_datepicker_large).attr("id", "none");
+        
     } else {
         $(start_date).attr("id", "start-date")
         $(end_date).attr("id", "end-date");
+        $(start_datepicker_large).attr("id", "start-jrdatepicker");
+        $(end_datepicker_large).attr("id", "end-jrdatepicker");
     }
     $(window).resize( function () { 
         if ($(window).width() < 1024) {
            $(start_date).attr("id", "none");
            $(end_date).attr("id", "none");
+           $(start_datepicker_large).attr("id", "none");
+           $(end_datepicker_large).attr("id", "none");
             
         } else {
            $(start_date).attr("id", "start-date");
            $(end_date).attr("id", "end-date");
+            $(start_datepicker_large).attr("id", "start-jrdatepicker");
+            $(end_datepicker_large).attr("id", "end-jrdatepicker");
         }
     });
     
index d708318..d88c670 100644 (file)
@@ -1,6 +1,6 @@
 <div id="resContent">
         <div class="row resDropdown">
-            <div id="resform-wrapper" class="small-12 column">
+            <div id="resform-wrapper" class="small-12 column show-for-large-up">
             <?php if(is_front_page())  { ?>
                 <script src="http://widgets.bookdirect.net/widgets/search_widget.js.php?id=884" type="text/javascript"></script>
              <?php } else { ?>