mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Avoid collision between datepicker calendar dialog and date input field, try to use left or right free spaces
This commit is contained in:
parent
4e689e75a7
commit
b3689526dd
@ -91,6 +91,28 @@ var et2_date = et2_inputWidget.extend(
|
|||||||
this.input_date.addClass("et2_time");
|
this.input_date.addClass("et2_time");
|
||||||
this.egw().time(this.input_date);
|
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
|
// Update internal value when changed
|
||||||
var self = this;
|
var self = this;
|
||||||
this.input_date.bind('change', function(e){
|
this.input_date.bind('change', function(e){
|
||||||
|
Loading…
Reference in New Issue
Block a user