From 4eb90976e3d2097c78b878c142cad3ed94a09214 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Mon, 18 Feb 2013 11:10:35 +0100 Subject: [PATCH] =?UTF-8?q?allow=20to=20easily=20setup=20tooltips=20for=20?= =?UTF-8?q?specific=20elements=20that=20jQueryUI=20doesn=E2=80=99t=20detec?= =?UTF-8?q?t=20automatically.=20Also=20add=20workaround=20in=20case=20tool?= =?UTF-8?q?tips=20linger.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/boot.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/boot.js b/code/boot.js index bd6c4725..4985fa5d 100644 --- a/code/boot.js +++ b/code/boot.js @@ -190,8 +190,9 @@ window.setupSidebarToggle = function() { }); } -window.setupTooltips = function() { - $(document).tooltip({ +window.setupTooltips = function(element) { + element = element || $(document); + element.tooltip({ // disable show/hide animation show: { effect: "hide", duration: 0 } , hide: false, @@ -233,6 +234,11 @@ window.setupTooltips = function() { return tooltip; } }); + + if(!window.tooltipClearerHasBeenSetup) { + window.tooltipClearerHasBeenSetup = true; + $(document).on('click', '.ui-tooltip', function() { $(this).remove(); }); + } }