Skip to content

The Unified and Autonomous Development Platform

fix: more button in commits is not updating

Robin Shen9cd7f6ec5e9d
diff --git a/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.html
index ae6177a299..ab09683781 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.html
+++ b/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.html
@@ -24,7 +24,7 @@
</ul>
<div wicket:id="noCommits" class="no-commits"></div>
</div>
- <div class="foot text-center">
+ <div wicket:id="foot" class="foot text-center">
<a wicket:id="more" class="btn btn-primary">More commits</a>
<div wicket:id="tooMany" class="mt-4 mb-0 alert alert-light-warning">Too many commits to load</div>
</div>
diff --git a/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java
index 2d2b9590c4..8cd8d4df94 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java
@@ -215,7 +215,7 @@ public abstract class CommitListPanel extends Panel {
private WebMarkupContainer body;
- private WebMarkupContainer tooMany;
+ private WebMarkupContainer foot;
private RepeatingView commitsView;
@@ -261,7 +261,7 @@ public abstract class CommitListPanel extends Panel {
private void doQuery(AjaxRequestTarget target) {
page = 1;
target.add(body);
- target.add(tooMany);
+ target.add(foot);
querySubmitted = true;
target.appendJavaScript(renderCommitGraph());
if (SecurityUtils.getUser() != null && getQuerySaveSupport() != null)
@@ -393,7 +393,10 @@ public abstract class CommitListPanel extends Panel {
});
- add(new AjaxLink<Void>("more") {
+ add(foot = new WebMarkupContainer("foot"));
+ foot.setOutputMarkupId(true);
+
+ foot.add(new AjaxLink<Void>("more") {
private RunTaskBehavior taskBehavior;
@@ -445,7 +448,7 @@ public abstract class CommitListPanel extends Panel {
body.getMarkupId(), item.getMarkupId()));
}
target.prependJavaScript(builder);
- target.add(tooMany);
+ target.add(foot);
target.appendJavaScript(renderCommitGraph());
getProject().cacheCommitStatuses(getBuildManager().queryStatus(getProject(), getCommitIdsToQueryStatus()));
@@ -467,7 +470,7 @@ public abstract class CommitListPanel extends Panel {
});
- add(tooMany = new WebMarkupContainer("tooMany") {
+ foot.add(new WebMarkupContainer("tooMany") {
@Override
protected void onConfigure() {
@@ -476,7 +479,6 @@ public abstract class CommitListPanel extends Panel {
}
});
- tooMany.setOutputMarkupPlaceholderTag(true);
setOutputMarkupId(true);
}