From: Florent Bruneau Date: Sun, 27 Feb 2011 13:28:56 +0000 (+0100) Subject: Fix some behavior on firefox. X-Git-Tag: xorg/1.1.0~126 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c145766ba9ec9e917841f0fa0954642e9f4fd1f4;p=platal.git Fix some behavior on firefox. Signed-off-by: Florent Bruneau --- 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;