Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Foster2015-07-08 12:10:24 -0400
committerBob Foster2015-07-08 12:10:24 -0400
commit923957645a0e396b043d1e587c12c31acb40c5ec (patch)
tree63adb4024e97225ccf37abdaaf1adc96af430358 /hudson-core/src/main/resources/hudson
parentfe4a34c4b879f93389ba86029a2dd72f6523f860 (diff)
downloadorg.eclipse.hudson.core-923957645a0e396b043d1e587c12c31acb40c5ec.tar.gz
org.eclipse.hudson.core-923957645a0e396b043d1e587c12c31acb40c5ec.tar.xz
org.eclipse.hudson.core-923957645a0e396b043d1e587c12c31acb40c5ec.zip
Fix Bug 471474 - When “More…” is clicked from the Build History area, all the existing builds will be displayed twice
Diffstat (limited to 'hudson-core/src/main/resources/hudson')
-rw-r--r--hudson-core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly35
1 files changed, 23 insertions, 12 deletions
diff --git a/hudson-core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly b/hudson-core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly
index 5637185f..9ddf2ff2 100644
--- a/hudson-core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly
+++ b/hudson-core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly
@@ -7,11 +7,11 @@
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
-# Contributors:
+# Contributors:
#
# Kohsuke Kawaguchi, Winston Prakash
-#
-#************************************************************************** -->
+#
+#************************************************************************** -->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
@@ -30,6 +30,13 @@
</j:parse>
<div id="buildHistoryDiv">
<script>
+ function replace(a, b) {
+ var p = a.parentNode;
+ var next = a.nextSibling;
+ p.removeChild(a);
+ p.insertBefore(b,next);
+ }
+
function loadAllBuildHistory() {
// first display the "loading..." icon
var box = $("loadAllBuildHistory");
@@ -40,15 +47,19 @@
method: "get",
onComplete: function(rsp,_) {
<!-- neither outerHTML nor responseXML works in Firefox 2.0 -->
+ // Save headers from buildHistory
var hist = $$("buildHistory");
- var p = hist.parentNode;
- var next = hist.nextSibling;
- p.removeChild(hist);
+ var histheaders = hist.headers;
- var div = document.createElement('div');
- div.innerHTML = rsp.responseText;
+ // Swap the divs
+ var olddiv = $$("buildHistoryDiv");
+ var newdiv = document.createElement('div');
+ newdiv.innerHTML = rsp.responseText;
+ replace(olddiv, newdiv);
- p.insertBefore(div,next);
+ // Add headers to new buildHistory
+ hist = $$("buildHistory");
+ hist.headers = histheaders;
}
});
}
@@ -87,8 +98,8 @@
</td>
</tr>
</l:pane>
+ <script defer="true">
+ updateBuildHistory("${it.baseUrl}/buildHistory/ajax",${it.nextBuildNumberToFetch});
+ </script>
</div>
- <script defer="true">
- updateBuildHistory("${it.baseUrl}/buildHistory/ajax",${it.nextBuildNumberToFetch});
- </script>
</j:jelly>

Back to the top