From 69835e0f8a11664ec7fa9b894bd44d6bef11df7e Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 16 Apr 2013 16:57:16 -0700 Subject: [PATCH] Additional 'inside' class allows pre-allocation of the context menu space --- .../main/resources/hudson/widgets/HistoryWidget/entry.jelly | 2 +- core/src/main/resources/lib/layout/breadcrumbs.css | 5 +++++ core/src/main/resources/lib/layout/breadcrumbs.js | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly index c21b4762af..66cdd3099c 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly @@ -35,7 +35,7 @@ THE SOFTWARE. ${build.displayName} - + diff --git a/core/src/main/resources/lib/layout/breadcrumbs.css b/core/src/main/resources/lib/layout/breadcrumbs.css index b36e91614d..6cc9d58aa6 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.css +++ b/core/src/main/resources/lib/layout/breadcrumbs.css @@ -58,4 +58,9 @@ position: absolute; visibility: hidden; cursor: pointer; + z-index: 999; +} + +A.model-link.inside {/* additional 'inside' class allows pre-allocation of the context menu space */ + padding-right: 16px; } \ No newline at end of file diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 487c4688d1..db599dbabf 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -100,10 +100,12 @@ var breadcrumbs = (function() { * DOM node to attach this selector to. */ menuSelector.show = function(target) { - var xy = YAHOO.util.Dom.getXY(target); + var xy = Dom.getXY(target); + if ($(target).hasClassName("inside")) + xy[0] -= this.offsetWidth; // show the menu selector inside the text xy[0] += target.offsetWidth; xy[1] += target.offsetHeight/2 - this.offsetHeight/2; - YAHOO.util.Dom.setXY(this, xy); + Dom.setXY(this, xy); this.target = target; this.style.visibility = "visible"; -- GitLab