Allow mouse over tooltip

This commit is contained in:
Nathan Gray 2015-11-13 00:53:23 +00:00
parent d2e689d897
commit 41380c589f
2 changed files with 24 additions and 10 deletions

View File

@ -44,15 +44,32 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM],
init: function() { init: function() {
this._super.apply(this, arguments); this._super.apply(this, arguments);
var event = this;
// Main container // Main container
this.div = $j(document.createElement("div")) this.div = $j(document.createElement("div"))
.addClass("calendar_calEvent") .addClass("calendar_calEvent")
.addClass(this.options.class) .addClass(this.options.class)
.css('width',this.options.width) .css('width',this.options.width)
.on('mouseenter', function() { .on('mouseenter', function() {
// Hacky to remove egw's tooltip border // Hacky to remove egw's tooltip border and let the mouse in
window.setTimeout(function() { window.setTimeout(function() {
$j('body .egw_tooltip').css('border','none'); $j('body .egw_tooltip')
.css('border','none')
.on('mouseenter', function() {
event.div.off('mouseleave.tooltip');
$j('body.egw_tooltip').remove();
$j('body').append(this);
$j(this).stop(true).fadeTo(400, 1)
.on('mouseleave', function() {
$j(this).fadeOut('400', function() {
$j(this).remove();
// Set up to work again
event.set_statustext(event._tooltip());
});
});
});
},105); },105);
}); });
this.title = $j(document.createElement('div')) this.title = $j(document.createElement('div'))

View File

@ -634,14 +634,11 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
.css('height', (this.options.height - this.gridHeader.outerHeight(true))+'px'); .css('height', (this.options.height - this.gridHeader.outerHeight(true))+'px');
var new_height = this.scrolling.height() / rowsToDisplay; var new_height = this.scrolling.height() / rowsToDisplay;
if(new_height != this.rowHeight)
{
this.rowHeight = new_height; this.rowHeight = new_height;
var rows = $j('.calendar_calTimeRow',this.scrolling).height(this.rowHeight); var rows = $j('.calendar_calTimeRow',this.scrolling).height(this.rowHeight);
this.days.css('height', (this.rowHeight*rows.length)+'px'); this.days.css('height', (this.rowHeight*rows.length)+'px');
$j('.calendar_calAddEvent',this.scrolling).height(this.rowHeight); $j('.calendar_calAddEvent',this.scrolling).height(this.rowHeight);
}
// Scroll to start of day // Scroll to start of day
this._top_time = (wd_start * this.rowHeight) / this.options.granularity; this._top_time = (wd_start * this.rowHeight) / this.options.granularity;
this.scrolling.scrollTop(this._top_time); this.scrolling.scrollTop(this._top_time);