Skip to content

Commit 47bb5d9

Browse files
committed
Fixed top alignment
1 parent 6be71ef commit 47bb5d9

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

dist/css/DatePickerX.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @copyright 2016 Avrora Team www.avrora.team
99
* @license MIT
1010
* @tutorial http://datepickerx.avrora.team
11-
* @version 1.0.3
11+
* @version 1.0.4
1212
*/
1313

1414
.date-picker-x-container {

dist/css/DatePickerX.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/DatePickerX.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @copyright 2016 Avrora Team www.avrora.team
99
* @license MIT
1010
* @tutorial http://datepickerx.avrora.team
11-
* @version 1.0.3
11+
* @version 1.0.4
1212
*/
1313

1414
!function()
@@ -207,7 +207,10 @@
207207
elements.container.classList.remove('to-top');
208208

209209
var bcr = elements.container.getBoundingClientRect();
210-
bcr.bottom > window.innerHeight && bcr.top > elements.container.offsetHeight && elements.container.classList.add('to-top');
210+
if (bcr.bottom > window.innerHeight && bcr.top + input.offsetHeight > elements.container.offsetHeight) {
211+
elements.container.classList.add('to-top');
212+
elements.container.getBoundingClientRect().top < 0 && elements.container.classList.remove('to-top');
213+
}
211214

212215
openedDPX && openedDPX !== elements.container && openedDPX.classList.remove('active');
213216
openedDPX = elements.container;

0 commit comments

Comments
 (0)