From c5e27877d336280b0e7d2ad5546f3833d110f468 Mon Sep 17 00:00:00 2001 From: Li Chuangbo Date: Thu, 6 Nov 2014 10:47:07 +1300 Subject: [PATCH 1/2] Fixed place error when not enough space under When there is not enough space between input and bottom of window, input will display above input instead. But the position should be top of input reduce height of widget. --- js/foundation-datepicker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/foundation-datepicker.js b/js/foundation-datepicker.js index 5b82a25..9d4d1a2 100644 --- a/js/foundation-datepicker.js +++ b/js/foundation-datepicker.js @@ -140,7 +140,7 @@ this.endDate = Infinity; this.daysOfWeekDisabled = []; this.setStartDate(options.startDate||this.element.data('date-startdate')); - this.setEndDate(options.endDate||this.element.data('date-enddate')); + this.setEndDate(options.endDate||this.element.data('datepla-enddate')); this.setDaysOfWeekDisabled(options.daysOfWeekDisabled||this.element.data('date-days-of-week-disabled')); this.fillDow(); @@ -331,8 +331,8 @@ var fullOffsetTop = offset.top + height; var offsetLeft = offset.left; // if the datepicker is going to be below the window, show it on top of the input - if((fullOffsetTop + this.picker.height()) >= $(window).scrollTop() + $(window).height()){ - fullOffsetTop = offset.top - height - this.picker.height(); + if((fullOffsetTop + this.picker.outerHeight()) >= $(window).scrollTop() + $(window).height()){ + fullOffsetTop = offset.top - this.picker.outerHeight(); } // if the datepicker is going to go past the right side of the window, we want From de05fb5432f486f6cf7a9894f8d97ac3fb90a9d3 Mon Sep 17 00:00:00 2001 From: Li Chuangbo Date: Thu, 6 Nov 2014 10:48:07 +1300 Subject: [PATCH 2/2] xxx --- js/foundation-datepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/foundation-datepicker.js b/js/foundation-datepicker.js index 9d4d1a2..1a705c9 100644 --- a/js/foundation-datepicker.js +++ b/js/foundation-datepicker.js @@ -140,7 +140,7 @@ this.endDate = Infinity; this.daysOfWeekDisabled = []; this.setStartDate(options.startDate||this.element.data('date-startdate')); - this.setEndDate(options.endDate||this.element.data('datepla-enddate')); + this.setEndDate(options.endDate||this.element.data('date-enddate')); this.setDaysOfWeekDisabled(options.daysOfWeekDisabled||this.element.data('date-days-of-week-disabled')); this.fillDow();