From e0cef4d91dd94e5ba3cbbf3f23ab2eb02820f203 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Sun, 24 Nov 2013 22:09:13 +0000 Subject: [PATCH] fixes #4099 fix tooltip is not displayed after clicking a link and going back to the visitor link. Seems to be a bug in jQueryUI but could workaround it. Unfortunately, I did not find the actual issue in jquery and also did not find a ticket for that --- plugins/Live/javascripts/visitorLog.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/Live/javascripts/visitorLog.js b/plugins/Live/javascripts/visitorLog.js index 5307a4d1545..2287e5649cc 100644 --- a/plugins/Live/javascripts/visitorLog.js +++ b/plugins/Live/javascripts/visitorLog.js @@ -51,8 +51,18 @@ prevhtml = current; prevelement = $(this); } - - $(this).tooltip({ + + var $this = $(this); + var tooltipIsOpened = false; + + $('a', $this).on('focus', function () { + // see http://dev.piwik.org/trac/ticket/4099 + if (tooltipIsOpened) { + $this.tooltip('close'); + } + }); + + $this.tooltip({ track: true, show: false, hide: false, @@ -60,7 +70,9 @@ var title = $(this).attr('title'); return $('').text( title ).html().replace(/\n/g, '
'); }, - tooltipClass: 'small' + tooltipClass: 'small', + open: function() { tooltipIsOpened = true; }, + close: function() { tooltipIsOpened = false; } }); }); });