Skip to content

The Unified and Autonomous Development Platform

Fix some minor display issues.

robin shine76e07b0f52ef
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java
index 5bef6b5d61..38443de20e 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java
@@ -252,6 +252,13 @@ public class SourceViewPanel extends BlobViewPanel {
public void onClick(AjaxRequestTarget target) {
mark(target, context.getComment().getMark(), true);
context.onMark(target, context.getComment().getMark());
+ target.appendJavaScript(String.format("$('#%s').blur();", getMarkupId()));
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+ setOutputMarkupId(true);
}
});
@@ -435,7 +442,7 @@ public class SourceViewPanel extends BlobViewPanel {
commentContainer.replace(commentPanel);
commentContainer.setVisible(true);
target.add(commentContainer);
- String script = String.format("gitplex.sourceview.onShowComment(%s);",
+ String script = String.format("gitplex.sourceview.onOpenComment(%s);",
getJsonOfComment(commentModel.getObject()));
target.appendJavaScript(script);
context.onOpenComment(target, commentModel.getObject());
@@ -599,7 +606,7 @@ public class SourceViewPanel extends BlobViewPanel {
commentContainer.replace(new WebMarkupContainer(BODY_ID));
commentContainer.setVisible(false);
target.add(commentContainer);
- target.appendJavaScript("gitplex.sourceview.onShowComment();");
+ target.appendJavaScript("gitplex.sourceview.onOpenComment();");
}
private List<Symbol> getChildSymbols(@Nullable Symbol parentSymbol) {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js
index b796eeef88..b5eed668da 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js
@@ -247,27 +247,28 @@ gitplex.sourceview = {
}
});
},
- addCommentGutter: function(line, commentInfos) {
+ restoreMark: function() {
var cm = $(".source-view>.code>.CodeMirror")[0].CodeMirror;
- var commentCallback = $(".source-view").data("commentCallback");
- function restoreMark() {
- var uri = new URI(window.location.href);
- var markStr = uri.search(true).mark;
- if (markStr) {
- var splitted = markStr.split("-");
- var fromInfo = splitted[0].split(".");
- var toInfo = splitted[1].split(".");
- var mark = {
- beginLine: parseInt(fromInfo[0])-1,
- beginChar: parseInt(fromInfo[1]),
- endLine: parseInt(toInfo[0])-1,
- endChar: parseInt(toInfo[1])
- }
- pmease.commons.codemirror.mark(cm, mark, false);
- } else {
- pmease.commons.codemirror.clearMark(cm);
+ var uri = new URI(window.location.href);
+ var markStr = uri.search(true).mark;
+ if (markStr) {
+ var splitted = markStr.split("-");
+ var fromInfo = splitted[0].split(".");
+ var toInfo = splitted[1].split(".");
+ var mark = {
+ beginLine: parseInt(fromInfo[0])-1,
+ beginChar: parseInt(fromInfo[1]),
+ endLine: parseInt(toInfo[0])-1,
+ endChar: parseInt(toInfo[1])
}
+ pmease.commons.codemirror.mark(cm, mark, false);
+ } else {
+ pmease.commons.codemirror.clearMark(cm);
}
+ },
+ addCommentGutter: function(line, commentInfos) {
+ var cm = $(".source-view>.code>.CodeMirror")[0].CodeMirror;
+ var commentCallback = $(".source-view").data("commentCallback");
var $gutter = $(document.createElement("div"));
$gutter.addClass("CodeMirror-comment");
@@ -295,7 +296,7 @@ gitplex.sourceview = {
pmease.commons.codemirror.mark(cm, commentInfo.mark, false);
});
$(this).mouseout(function() {
- restoreMark();
+ gitplex.sourceview.restoreMark();
});
$(this).click(function() {
if ($(".source-view form.dirty").length != 0
@@ -316,7 +317,7 @@ gitplex.sourceview = {
pmease.commons.codemirror.mark(cm, commentInfo.mark, false);
});
$commentLink.mouseout(function() {
- restoreMark();
+ gitplex.sourceview.restoreMark();
});
$commentLink.click(function() {
if ($(".source-view form.dirty").length != 0
@@ -374,11 +375,13 @@ gitplex.sourceview = {
gitplex.sourceview.highlightCommentTrigger();
gitplex.sourceview.onLayoutChange();
},
- onShowComment: function(commentInfo) {
+ onOpenComment: function(commentInfo) {
gitplex.sourceview.highlightCommentTrigger();
gitplex.sourceview.onLayoutChange();
if (commentInfo)
gitplex.sourceview.mark(commentInfo.mark, false);
+ else
+ gitplex.sourceview.restoreMark();
},
onToggleOutline: function() {
gitplex.sourceview.onLayoutChange();
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/depot-file.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/depot-file.css
index 3eaf005cc4..d10932e34f 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/depot-file.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/file/depot-file.css
@@ -98,6 +98,7 @@
}
#repo-file>.contribution .hash a {
font-family: monospace;
+ font-size: 13px;
}
#repo-file>.contribution .date {
margin-left: 12px;