From: Anthony Talarico Date: Thu, 28 Jul 2016 18:22:57 +0000 (-0400) Subject: adding another function for the datepicker in for departure input in the off canvas... X-Git-Tag: v1.0.0^2~242 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=ff0a5c0ab4f9ec1f6b4ce16cb5b7957f59d9993e;p=WP-Themes%2Fpetoskeyarea.git adding another function for the datepicker in for departure input in the off canvas menu booking widget to center the datepicker and hide the keyboard --- diff --git a/js/app.js b/js/app.js index cad5c21..09d439f 100644 --- a/js/app.js +++ b/js/app.js @@ -79,7 +79,12 @@ $(document).ready(function () { } }); - $(off_canvas_departure).datepicker(); + $(off_canvas_departure).datepicker({ + beforeShow: function(input, inst) + { + inst.dpDiv.css({marginTop: -input.offsetHeight + 'px', marginLeft: '-20px'}); + } + }); $(off_canvas_arrival).change( function () { var min_date = $(this).datepicker('getDate', '+1d'); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 6c9eafb..ab93332 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -70,7 +70,12 @@ $(document).ready(function () { } }); - $(off_canvas_departure).datepicker(); + $(off_canvas_departure).datepicker({ + beforeShow: function(input, inst) + { + inst.dpDiv.css({marginTop: -input.offsetHeight + 'px', marginLeft: '-20px'}); + } + }); $(off_canvas_arrival).change( function () { var min_date = $(this).datepicker('getDate', '+1d');