提交 a2a398ed 编写于 作者: K Kohsuke Kawaguchi

merge the tooltip to the context menu

上级 e7f56d3d
......@@ -66,9 +66,11 @@ Upcoming changes</a>
<li class=bug>
WARNING: Caught exception evaluating: descriptor.getHelpFile(attrs.field). Reason: java.lang.NullPointerException.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15940">issue 15940</a>)
<li class=rfe>
<li class=rfe>
Allows to disable triggering of downstream jobs (for a maven job)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-1295">issue 1295</a>)
<li class=bug>
Context menu and tooltip of the queue items were colliding with each other
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -58,11 +58,11 @@ THE SOFTWARE.
<j:otherwise>
<j:forEach var="item" items="${items}">
<tr>
<td class="pane" width="100%" tooltip="${item.why}${h.escape(item.params)}&lt;br&gt;${%WaitingFor(item.inQueueForString)}" style="white-space: normal;">
<td class="pane" width="100%" style="white-space: normal;">
<j:set var="stuck" value="${item.isStuck()}"/>
<j:choose>
<j:when test="${h.hasPermission(item.task,item.task.READ)}">
<a href="${rootURL}/${item.task.url}" class="model-link">
<a href="${rootURL}/${item.task.url}" class="model-link tl-tr" tooltip="${item.why}${h.escape(item.params)}&lt;br&gt;${%WaitingFor(item.inQueueForString)}">
${item.task.fullDisplayName}
</a>
<j:if test="${stuck}">
......
......@@ -67,6 +67,10 @@ var breadcrumbs = (function() {
}
/**
* Called when the mouse cursor comes into the context menu hot spot.
*
* If the mouse stays there for a while, a context menu gets displayed.
*
* @param {HTMLElement} e
* anchor tag
* @param {Number} delay
......@@ -87,6 +91,7 @@ var breadcrumbs = (function() {
menu.addItems(items);
menu.render("breadcrumb-menu-target");
menu.show();
$(menu.getItem(0).element).addClassName("yui-menuitem-tooltip")
}
menuDelay = null;
},delay);
......@@ -108,6 +113,13 @@ var breadcrumbs = (function() {
e.subMenu = {id:"submenu"+(iota++), itemdata:e.subMenu.items.each(fillMenuItem)};
}
a.each(fillMenuItem);
var tooltip = e.getAttribute('tooltip');
if (tooltip) {
// join the tooltip into the context menu. color #000 to cancel out the text effect on disabled menu items
a.unshift({text:"<div class='yui-menu-tooltip'>"+tooltip+"</div>", disabled:true})
}
e.items = function() { return a };
showMenu(a);
}
......
......@@ -867,6 +867,17 @@ DIV.yahooTree td {
border: none !important;
background-color: #FFF !important;
}
.yuimenu LI .yui-menu-tooltip {
color: #A6A6A6;
}
.yuimenu LI.yui-menuitem-tooltip {
border-bottom: 1px solid #808080;
padding-bottom: 3px;
margin-bottom: 1em;
}
/* ========================= search box at the top-right of the page ========================= */
#search-box {
background: white url(../images/16x16/search.gif) no-repeat 2px center;
......
......@@ -1183,6 +1183,8 @@ var hudsonRules = jenkinsRules; // legacy name
Behaviour.register(hudsonRules);
function applyTooltip(e,text) {
if (e.hasClassName("model-link")) return; // tooltip gets handled by context menu
// 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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册