]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
put in a workaround for tags being above the image for managing the hover events
authorcash <cash.costello@gmail.com>
Mon, 2 Jan 2012 21:37:45 +0000 (16:37 -0500)
committercash <cash.costello@gmail.com>
Mon, 2 Jan 2012 21:37:45 +0000 (16:37 -0500)
views/default/js/photos/tagging.php

index 47bab9de5cbc5946fee8cc6976472b95f58b9005..a3c7efc1ca5d15c0814e92a693293cf49c97fe25 100644 (file)
@@ -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 {