removed extraneous datepicker code that is no longer used as it was replaced by the...
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jul 2016 12:40:26 +0000 (08:40 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jul 2016 12:40:26 +0000 (08:40 -0400)
js/app.js
js/custom/pageSetup.js

index db3bffd..027fa07 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -59,57 +59,6 @@ $(document).ready(function () {
         $(res_form).css("left", x_pos - (length - book_width) + "px");
     });
     
-//    $("#start-date").on("click", function () {
-//       if($(this).find(".jrdp_calendar_pos").has('table')){
-//           if ($(window).width() < 1024) {
-//                console.debug($(this).find("#start-jrdatepicker").css("position"));
-//            }
-//        }
-//    });
-    
-     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).datepicker({
-
-//          minDate: 0,
-//          beforeShow: function (input, inst) {
-//            setTimeout(function () {
-//            inst.dpDiv.css({
-//                top: 100,
-//                left: 50
-//            });
-//            }, 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_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);
-////             }
-//          });
-    
-
-    
     $("header").find('ul').find('li').children('a').on("click", function (){
         if($(".searchform").css("display") === "none"){
             $(".searchform").slideDown("slow", function() {
@@ -129,31 +78,24 @@ $(document).ready(function () {
     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 () { 
+    function remove_datepicker(){
         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");
-            
+            $(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_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");
         }
+    }
+    remove_datepicker();
+    
+    $(window).resize( function () { 
+        remove_datepicker();
     });
     
     function check_window_width(){
@@ -179,5 +121,4 @@ $(document).ready(function () {
     }
     check_window_width();
     
-    
 });
index 2e4d710..c6a4960 100644 (file)
@@ -50,57 +50,6 @@ $(document).ready(function () {
         $(res_form).css("left", x_pos - (length - book_width) + "px");
     });
     
-//    $("#start-date").on("click", function () {
-//       if($(this).find(".jrdp_calendar_pos").has('table')){
-//           if ($(window).width() < 1024) {
-//                console.debug($(this).find("#start-jrdatepicker").css("position"));
-//            }
-//        }
-//    });
-    
-     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).datepicker({
-
-//          minDate: 0,
-//          beforeShow: function (input, inst) {
-//            setTimeout(function () {
-//            inst.dpDiv.css({
-//                top: 100,
-//                left: 50
-//            });
-//            }, 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_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);
-////             }
-//          });
-    
-
-    
     $("header").find('ul').find('li').children('a').on("click", function (){
         if($(".searchform").css("display") === "none"){
             $(".searchform").slideDown("slow", function() {
@@ -120,31 +69,24 @@ $(document).ready(function () {
     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 () { 
+    function remove_datepicker(){
         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");
-            
+            $(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_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");
         }
+    }
+    remove_datepicker();
+    
+    $(window).resize( function () { 
+        remove_datepicker();
     });
     
     function check_window_width(){
@@ -170,5 +112,4 @@ $(document).ready(function () {
     }
     check_window_width();
     
-    
 });