From ff0a5c0ab4f9ec1f6b4ce16cb5b7957f59d9993e Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 28 Jul 2016 14:22:57 -0400 Subject: [PATCH] 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 --- js/app.js | 7 ++++++- js/custom/pageSetup.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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'); -- 2.17.1