Merge pull request #383 from JSoon/master

Bug fixed - The datetimepicker will overflow-y
This commit is contained in:
Valeriy 2016-02-01 19:37:02 +05:00
commit 704d50318f

View File

@ -1986,7 +1986,26 @@
current_time_index = 0; current_time_index = 0;
setPos = function () { setPos = function () {
var offset = datetimepicker.data('input').offset(), datetimepickerelement = datetimepicker.data('input')[0], top = offset.top + datetimepickerelement.offsetHeight - 1, left = offset.left, position = "absolute", node; /**
* 修复输入框在window最右边且输入框的宽度小于日期控件宽度情况下日期控件显示不全的bug
* Bug fixed - The datetimepicker will overflow-y when the width of the date input less than its, which
* could causes part of the datetimepicker being hidden.
* by Soon start
*/
var offset = datetimepicker.data('input').offset(),
datetimepickerelement = datetimepicker.data('input')[0],
top = offset.top + datetimepickerelement.offsetHeight - 1,
left = offset.left,
position = "absolute",
node;
if ((document.documentElement.clientWidth - offset.left) < datepicker.parent().outerWidth(true)) {
var diff = datepicker.parent().outerWidth(true) - datetimepickerelement.offsetWidth;
left = left - diff;
}
/**
* by Soon end
*/
if (datetimepicker.data('input').parent().css('direction') == 'rtl') if (datetimepicker.data('input').parent().css('direction') == 'rtl')
left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth()); left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth());
if (options.fixed) { if (options.fixed) {