diff options
-rw-r--r-- | views/default/js/photos/tagging.php | 16 |
1 files changed, 14 insertions, 2 deletions
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 { |