forked from extern/egroupware
Avoid collision between datepicker calendar dialog and date input field, try to use left or right free spaces
This commit is contained in:
parent
bac32cce82
commit
7e692945cf
@ -91,6 +91,28 @@ var et2_date = et2_inputWidget.extend(
|
||||
this.input_date.addClass("et2_time");
|
||||
this.egw().time(this.input_date);
|
||||
}
|
||||
|
||||
// Avoid collision of datepicker dialog with input field
|
||||
this.input_date.datepicker('option', 'beforeShow', function(input, inst){
|
||||
var cal = inst.dpDiv;
|
||||
setTimeout(function () {
|
||||
var $input = jQuery(input);
|
||||
var inputOffset = $input.offset();
|
||||
// position the datepicker in freespace zone
|
||||
// avoid datepicker calendar collision with input field
|
||||
if (cal.height() + inputOffset.top > window.innerHeight)
|
||||
{
|
||||
cal.position({
|
||||
my: "left center",
|
||||
at: 'right bottom',
|
||||
collision: 'flip fit',
|
||||
of: input,
|
||||
});
|
||||
}
|
||||
|
||||
},0);
|
||||
});
|
||||
|
||||
// Update internal value when changed
|
||||
var self = this;
|
||||
this.input_date.bind('change', function(e){
|
||||
|
Loading…
Reference in New Issue
Block a user