Add functionalities to CommentBox and fix various styles
- Added expandText() to DraftBox. - Fixed CommentBox styles to make it look better. Added box-shadow. - Adjusted CodeMirror's line height to avoid cutting off the bottom of text. - Added refocusing on CM after clicking on CommentBoxes and SkipBars. - Prevented feedback loop in synced scrolling. - Fixed a bug in skip calculation. Change-Id: I7cbe644f3a890cb6e62a5d83942a93411ea5550f
This commit is contained in:
@@ -17,6 +17,7 @@ package com.google.gerrit.client.diff;
|
||||
import com.google.gerrit.client.patches.PatchUtil;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
@@ -65,12 +66,18 @@ class SkipBar extends Composite {
|
||||
private CodeMirror cm;
|
||||
private int numSkipLines;
|
||||
|
||||
SkipBar(CodeMirror cm) {
|
||||
this.cm = cm;
|
||||
SkipBar(CodeMirror cmInstance) {
|
||||
cm = cmInstance;
|
||||
skipNum = new Anchor(true);
|
||||
upArrow = new Anchor(true);
|
||||
downArrow = new Anchor(true);
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
cm.focus();
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
}
|
||||
|
||||
void setWidget(LineWidget widget) {
|
||||
|
||||
Reference in New Issue
Block a user