1
0
Fork 0

hovercard: fix hover-card does now working with ajax loaded content

This commit is contained in:
rabuzarus 2016-05-06 20:48:12 +02:00
parent 0ab7a210f9
commit 415c36e4bb

View file

@ -8,13 +8,10 @@
*
*/
$(document).ready(function(){
// Elements with the class "userinfo" will get a hover-card.
// Note that this elements does need a href attribute which links to
// a valid profile url
$('.userinfo').on("mouseover", function(e) {
// Elements with the class "userinfo" will get a hover-card.
// Note that this elements does need a href attribute which links to
// a valid profile url
$("body").on("mouseover", ".userinfo", function(e) {
var timeNow = new Date().getTime();
removeAllhoverCards(e,timeNow);
var hoverCardData = false;
@ -81,19 +78,14 @@ $(document).ready(function(){
}
}
}, 500);
}).on("mouseleave", function(e) { // action when mouse leaves the hover-card
}).on("mouseleave", ".userinfo", function(e) { // action when mouse leaves the hover-card
var timeNow = new Date().getTime();
// copy the original title to the title atribute
var title = $(this).attr("data-orig-title");
$(this).attr({"data-orig-title": "", title: title});
removeAllhoverCards(e,timeNow);
});
});
// hover cards should be removed very easily, e.g. when any of these events happen
$('body').on("mouseleave touchstart scroll click dblclick mousedown mouseup submit keydown keypress keyup", function(e){
var timeNow = new Date().getTime();