mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
Performance improvment for calender tooltip
This commit is contained in:
parent
2903ca4e7f
commit
32a52e75b0
@ -429,38 +429,50 @@ app.classes.calendar = AppJS.extend(
|
|||||||
jQuery("body")
|
jQuery("body")
|
||||||
//mouseover event handler for calendar tooltip
|
//mouseover event handler for calendar tooltip
|
||||||
.on("mouseover", "div[data-tooltip]",function(){
|
.on("mouseover", "div[data-tooltip]",function(){
|
||||||
var ttp = jQuery(this).tooltip({
|
//Check if the tooltip is already initialized
|
||||||
items: "[data-tooltip]",
|
if (!jQuery(this).data('uiTooltip'))
|
||||||
content: function()
|
{
|
||||||
{
|
jQuery(this).tooltip({
|
||||||
var elem = jQuery(this);
|
items: "[data-tooltip]",
|
||||||
if (elem.is("[data-tooltip]"))
|
show: false,
|
||||||
return this.getAttribute('data-tooltip') ;
|
content: function()
|
||||||
},
|
{
|
||||||
track:true,
|
var elem = jQuery(this);
|
||||||
|
if (elem.is("[data-tooltip]"))
|
||||||
|
return this.getAttribute('data-tooltip') ;
|
||||||
|
},
|
||||||
|
track:true,
|
||||||
|
|
||||||
open: function(event,ui){
|
open: function(event,ui){
|
||||||
ui.tooltip.removeClass("ui-tooltip");
|
ui.tooltip.removeClass("ui-tooltip");
|
||||||
ui.tooltip.addClass("calendar_uitooltip");
|
ui.tooltip.addClass("calendar_uitooltip");
|
||||||
},
|
if (this.scrollHeight > this.clientHeight)
|
||||||
close: function( event, ui )
|
{
|
||||||
{
|
// bind on tooltip close event
|
||||||
ui.tooltip.hover(
|
jQuery(this).on("tooltipclose", function (event, ui){
|
||||||
function () {
|
// bind hover handler on tooltip helper in order to be able to freeze the tooltip and scrolling
|
||||||
if (this.scrollHeight > this.clientHeight) jQuery(this).stop(true).fadeTo(100, 1);
|
ui.tooltip.hover(
|
||||||
},
|
function () {
|
||||||
function () {
|
if (this.scrollHeight > this.clientHeight) jQuery(this).stop(true).fadeTo(100, 1);
|
||||||
jQuery(this).fadeOut("100", function(){ jQuery(this).remove();});
|
},
|
||||||
|
function () {
|
||||||
|
jQuery(this).fadeOut("100", function(){ jQuery(this).remove();});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
ttp.tooltip("enable");
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// mousedown event handler for calendar tooltip to remove disable tooltip
|
// mousedown event handler for calendar tooltip to remove disable tooltip
|
||||||
.on("mousedown", "div[data-tooltip]", function(){
|
.on("mousedown", "div[data-tooltip]", function(){
|
||||||
jQuery(this).tooltip("disable");
|
// Make sure the tooltip initialized before calling it
|
||||||
|
if (jQuery(this).data('uiTooltip'))
|
||||||
|
{
|
||||||
|
jQuery(this).tooltip("disable");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//onClick event handler for calendar Events
|
//onClick event handler for calendar Events
|
||||||
|
Loading…
Reference in New Issue
Block a user