Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Disable build history refresh if the pane is collapsed
  • Loading branch information
tfennelly committed Oct 11, 2015
1 parent 727d77a commit 01b4ac7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/main/resources/lib/layout/pane.jelly
Expand Up @@ -48,19 +48,20 @@ THE SOFTWARE.
Footer of the box. Can include HTML.
</st:attribute>
</st:documentation>
<div class="container-fluid pane-frame track-mouse" id="${attrs.id}">
<j:set var="paneIsCollapsed" value="${h.isCollapsed(attrs.id)}" />
<div class="container-fluid pane-frame track-mouse ${paneIsCollapsed ? 'collapsed' : 'expanded'}" id="${attrs.id}">
<div class="row">
<div class="col-xs-24 pane-header">
<a class="collapse" href="${rootURL}/toggleCollapse?paneId=${attrs.id}"
title="${h.isCollapsed(attrs.id) ? '%expand' : '%collapse'}">
<l:icon alt="${h.isCollapsed(attrs.id) ? '%expand' : '%collapse'}" class="${h.isCollapsed(attrs.id) ? 'icon-expand' : 'icon-collapse'} icon-sm"/>
title="${paneIsCollapsed ? '%expand' : '%collapse'}">
<l:icon alt="${paneIsCollapsed ? '%expand' : '%collapse'}" class="${paneIsCollapsed ? 'icon-expand' : 'icon-collapse'} icon-sm"/>
</a>
<j:out value="${title}"/>
</div>
</div>
<j:choose>
<div class="row pane-content">
<j:when test="${h.isCollapsed(attrs.id)}">
<j:when test="${paneIsCollapsed}">
<div class="row">
<div class="col-xs-24 cell">${attrs.collapsedText}</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions war/src/main/webapp/scripts/hudson-behavior.js
Expand Up @@ -1588,6 +1588,13 @@ function fireBuildHistoryChanged() {
function updateBuildHistory(ajaxUrl,nBuild) {
if(isRunAsTest) return;
var bh = $('buildHistory');

// If the build history pane is collapsed, just return immediately and don't set up
// the build history refresh.
if (bh.hasClassName('collapsed')) {
return;
}

var buildHistoryPage = $('buildHistoryPage');

bh.headers = ["n",nBuild];
Expand Down

0 comments on commit 01b4ac7

Please sign in to comment.