From c145766ba9ec9e917841f0fa0954642e9f4fd1f4 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 27 Feb 2011 14:28:56 +0100 Subject: [PATCH] Fix some behavior on firefox. Signed-off-by: Florent Bruneau --- htdocs/javascript/xorg.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index e808504..2f80860 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -885,6 +885,7 @@ function sendTestEmail(token, hruid) var pos = findPos(input.get(0)); var $popup = destination; var selected = null; + var hovered = 0; function updateSelection() { @@ -902,24 +903,25 @@ function sendTestEmail(token, hruid) function formatProfile(i, profile) { var data = $.tmpl('quickMinifiche', profile) + .css('cursor', 'pointer') .hover(function() { selected = i; updateSelection(); + hovered++; }, function() { if (selected === i) { selected = null; updateSelection(); } + hovered--; }).mouseup(function() { var sel = $(this).find('a'); - try { - if (!sel.is(':hover')) { - sel.click(); - } - } catch (e) { + if (!sel.attr('hovered')) { sel.click(); } }); + data.find('a').hover(function() { $(this).attr('hovered', true) }, + function() { $(this).attr('hovered', false) }); return data; } @@ -939,7 +941,7 @@ function sendTestEmail(token, hruid) return { hide: function(ignoreIfHover) { - if (ignoreIfHover && $popup.is(':hover')) { + if (ignoreIfHover && hovered !== 0) { return true; } selected = null; -- 2.1.4