From: cash Date: Mon, 2 Jan 2012 21:37:45 +0000 (-0500) Subject: put in a workaround for tags being above the image for managing the hover events X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=599d1068636f8c1ba5c899ecdbd03aca7ebc5a0f;p=lorea%2Felgg.git put in a workaround for tags being above the image for managing the hover events --- diff --git a/views/default/js/photos/tagging.php b/views/default/js/photos/tagging.php index 47bab9de5..a3c7efc1c 100644 --- a/views/default/js/photos/tagging.php +++ b/views/default/js/photos/tagging.php @@ -124,8 +124,20 @@ elgg.tidypics.tagging.toggleTagHover = function() { function() { $('.tidypics-tag-wrapper').show(); }, - function() { - $('.tidypics-tag-wrapper').hide(); + function(event) { + // this check handles the tags appearing over the image + var mouseX = event.pageX; + var mouseY = event.pageY; + var offset = $('.tidypics-photo').offset(); + var width = $('.tidypics-photo').outerWidth() - 1; + var height = $('.tidypics-photo').outerHeight() - 1; + + mouseX -= offset.left; + mouseY -= offset.top; + + if (mouseX < 0 || mouseX > width || mouseY < 0 || mouseY > height) { + $('.tidypics-tag-wrapper').hide(); + } } ); } else {