From 65585f97f7a42a61921a60740fb991075d2ff8cf Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 21 Oct 2007 04:27:56 +0000 Subject: [PATCH] adding a mechanism to keep the tooltip. See http://www.nabble.com/Build-failure-tf4612458.html#a13309217 git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5366 71c3de6d-444a-0410-be80-ed276b4c234a --- war/resources/scripts/hudson-behavior.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/war/resources/scripts/hudson-behavior.js b/war/resources/scripts/hudson-behavior.js index b1e954d20a..9a287bc3fe 100644 --- a/war/resources/scripts/hudson-behavior.js +++ b/war/resources/scripts/hudson-behavior.js @@ -290,11 +290,16 @@ var hudsonRules = { form = null; // memory leak prevention }, - // hook up tooltip + // hook up tooltip. + // add nodismiss="" if you'd like to display the tooltip forever as long as the mouse is on the element. "[tooltip]" : function(e) { // copied from YAHOO.widget.Tooltip.prototype.configContext to efficiently add a new element // event registration via YAHOO.util.Event.addListener leaks memory, so do it by ourselves here - e.onmouseover = function(ev) { return tooltip.onContextMouseOver.call(this,YAHOO.util.Event.getEvent(ev),tooltip); } + e.onmouseover = function(ev) { + var delay = this.getAttribute("nodismiss")!=null ? 99999999 : 5000; + tooltip.cfg.setProperty("autodismissdelay",delay); + return tooltip.onContextMouseOver.call(this,YAHOO.util.Event.getEvent(ev),tooltip); + } e.onmousemove = function(ev) { return tooltip.onContextMouseMove.call(this,YAHOO.util.Event.getEvent(ev),tooltip); } e.onmouseout = function(ev) { return tooltip.onContextMouseOut .call(this,YAHOO.util.Event.getEvent(ev),tooltip); } e.title = e.getAttribute("tooltip"); -- GitLab