提交 6fb7a50d 编写于 作者: K Kohsuke Kawaguchi

[JENKINS-13995]

Fixed a bug where the context menu anchor 'v' disappears even when the mouse is still over a model link.
上级 d9ec2ce7
...@@ -20,6 +20,9 @@ var breadcrumbs = (function() { ...@@ -20,6 +20,9 @@ var breadcrumbs = (function() {
*/ */
var mouse; var mouse;
var logger = function() {};
// logger = function() { console.log.apply(console,arguments) }; // uncomment this line to enable logging
function makeMenuHtml(icon,displayName) { function makeMenuHtml(icon,displayName) {
return (icon!=null ? "<img src='"+icon+"' width=24 height=24 style='margin: 2px;' alt=''> " : "")+displayName; return (icon!=null ? "<img src='"+icon+"' width=24 height=24 style='margin: 2px;' alt=''> " : "")+displayName;
} }
...@@ -114,18 +117,27 @@ var breadcrumbs = (function() { ...@@ -114,18 +117,27 @@ var breadcrumbs = (function() {
canceller = new Delayed(function () { canceller = new Delayed(function () {
// if the mouse is in the hot spot for the selector, keep showing it // if the mouse is in the hot spot for the selector, keep showing it
var r = this.target ? Dom.getRegion(this.target) : false; var r = this.target ? Dom.getRegion(this.target) : false;
if (r && r.contains(mouse)) return; if (r && r.contains(mouse)) {
r = Dom.getRegion(menuSelector); logger("still in the hotspot");
if (r && r.contains(mouse)) return; return;
}
r = Dom.getRegion(this);
if (r && r.contains(mouse)) {
logger("still over the selector");
return;
}
logger("hiding 'v'");
menuSelector.hide(); menuSelector.hide();
}, 750); }.bind(menuSelector), 750);
menuSelector.onmouseover = function () { menuSelector.onmouseover = function () {
logger("mouse entered 'v'");
canceller.cancel(); canceller.cancel();
}; };
menuSelector.onmouseout = function () { menuSelector.onmouseout = function () {
canceller.schedule(); canceller.schedule();
logger("mouse left 'v'");
}; };
menuSelector.canceller = canceller; menuSelector.canceller = canceller;
...@@ -205,10 +217,12 @@ var breadcrumbs = (function() { ...@@ -205,10 +217,12 @@ var breadcrumbs = (function() {
// $(a).observe("mouseover", function () { handleHover(a,500); }); // $(a).observe("mouseover", function () { handleHover(a,500); });
a.onmouseover = function () { a.onmouseover = function () {
logger("mouse entered mode-link %s",this);
menuSelector.show(this); menuSelector.show(this);
}; };
a.onmouseout = function () { a.onmouseout = function () {
menuSelector.canceller.schedule(); menuSelector.canceller.schedule();
logger("mouse left model-link %s",this);
}; };
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册