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.

This commit is contained in:
J.Soon 2016-02-01 18:00:49 +08:00
parent 68dc8005f5
commit e0d2c27e63

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) {