Skip to content

The Unified and Autonomous Development Platform

Fix position inaccuracy of comment prev/next.

robin shine9b276bfe3833
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/back-to-top.png b/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/back-to-top.png
index dd0c681bab..96147701eb 100644
Binary files a/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/back-to-top.png and b/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/back-to-top.png differ
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/common.css b/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/common.css
index 6c26896508..63945c20dc 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/common.css
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/asset/common.css
@@ -200,5 +200,5 @@ div.tr {display: table-row;}
div.td {display: table-cell;}
/* BACK TO TOP */
-.back-to-top {position: fixed; right: 20px; bottom: 40px; cursor: pointer; padding: 24px;
- background: url("back-to-top.png") no-repeat 0 0; z-index: 100;}
\ No newline at end of file
+.back-to-top {position: fixed; right: 20px; bottom: 40px; cursor: pointer; padding: 25px;
+ background: url("back-to-top.png") no-repeat 0 0; z-index: 100; opacity: 0.8;}
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css
index a7518587b5..afcd311486 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/assets/css/page.css
@@ -805,7 +805,8 @@ h2.section-title { margin: 18px 0; font-size: 16px; }
.table-diff .line.comments>td {padding: 0 12px; border-top: 1px solid #DDD;
border-bottom: 1px solid #DDD;}
-.table-diff .line.comments td.avatar .concerned-comment {margin-top: 12px; font-size: 36px; color: #E7C325;}
+.table-diff .line.comments td.avatar .fa-flag {display: none; margin-top: 12px; font-size: 36px; color: #E7C325;}
+.table-diff .line.comments .concerned td.avatar .fa-flag {display: block;}
form#add-comment {margin: 16px 4px;}
.table-diff a.add-comment {position: absolute; left:0; margin-left: -20px;
width: 20px; height: 20px; text-decoration: none;}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.html
index 39e1e3e2ec..01f43a7294 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.html
@@ -47,7 +47,7 @@
<tr wicket:id="comments">
<td class="avatar">
<div wicket:id="avatar"></div>
- <div wicket:id="concerned" class="fa fa-flag concerned-comment" title="Concerned comment"></div>
+ <div class="fa fa-flag" title="Concerned comment"></div>
</td>
<td class="comment">
<div wicket:id="comment"></div>
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.java
index 713c66ef71..4081b4bf1a 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/TextDiffPanel.java
@@ -23,9 +23,11 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.event.IEvent;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.markup.head.OnLoadHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
@@ -321,7 +323,7 @@ public class TextDiffPanel extends Panel implements InlineContextAware {
setVisible(commentSupport != null && showComments && isDisplayingFull());
}
- }.add(new ScrollBehavior(".comments.line", 50, false)));
+ }.add(new ScrollBehavior("table.comments>tbody>tr", SCROLL_MARGIN, false)));
commentNavs.add(new WebMarkupContainer("nextComment") {
@@ -331,7 +333,7 @@ public class TextDiffPanel extends Panel implements InlineContextAware {
setVisible(commentSupport != null && showComments && isDisplayingFull());
}
- }.add(new ScrollBehavior(".comments.line", 50, true)));
+ }.add(new ScrollBehavior("table.comments>tbody>tr", SCROLL_MARGIN, true)));
commentNavs.add(new AjaxLink<Void>("showComments") {
@@ -651,7 +653,7 @@ public class TextDiffPanel extends Panel implements InlineContextAware {
add(newCommentsView());
- autoScrollScript = String.format("pmease.commons.scroll.next('.concerned-comment', %d);", SCROLL_MARGIN);
+ autoScrollScript = String.format("pmease.commons.scroll.next('table.comments>tbody>tr.concerned', %d);", SCROLL_MARGIN);
}
private String renderDiffs(List<DiffLine> diffLines) {
@@ -827,9 +829,9 @@ public class TextDiffPanel extends Panel implements InlineContextAware {
@Override
protected void populateItem(ListItem<InlineComment> item) {
item.add(new UserLink("avatar", new UserModel(item.getModelObject().getUser()), AvatarMode.AVATAR));
- item.add(new WebMarkupContainer("concerned")
- .setVisible(item.getModelObject().equals(commentSupport.getConcernedComment())));
item.add(new CommentPanel("comment", item.getModel()).setOutputMarkupId(true));
+ if (item.getModelObject().equals(commentSupport.getConcernedComment()))
+ item.add(AttributeAppender.append("class", " concerned"));
}
});
@@ -879,7 +881,7 @@ public class TextDiffPanel extends Panel implements InlineContextAware {
// caused by actions such as integrate/discard on request compare page will also
// get scrolled
if (autoScrollScript != null) {
- response.render(OnDomReadyHeaderItem.forScript(autoScrollScript));
+ response.render(OnLoadHeaderItem.forScript(autoScrollScript));
autoScrollScript = null;
}
}