Fix expandAfter(), add workaround for first lines

Previously the method was missing the "replacedWith" workaround for
first lines.

Added a LoadHandler to make the table cell containing the avatar
visible only when the avatar is loaded.

Change-Id: Ie0c69e1e70f3e1c5f0b4347e003ba68263140a0a
This commit is contained in:
Michael Zhou
2013-07-17 22:25:09 -07:00
parent 6744be7e93
commit 66ad65e7ea
2 changed files with 22 additions and 6 deletions

View File

@@ -153,12 +153,22 @@ class SkipBar extends Composite {
private void expandAfter() {
FromTo fromTo = marker.find();
int start = fromTo.getFrom().getLine();
int oldEnd = fromTo.getTo().getLine();
int newEnd = oldEnd - NUM_ROWS_TO_EXPAND;
marker.clear();
marker = cm.markText(CodeMirror.pos(fromTo.getFrom().getLine()),
CodeMirror.pos(newEnd),
COLLAPSED);
if (widget == null) { // First line workaround
marker = cm.markText(CodeMirror.pos(-1),
CodeMirror.pos(newEnd),
Configuration.create()
.set("inclusiveLeft", true)
.set("inclusiveRight", true)
.set("replacedWith", getElement()));
} else {
marker = cm.markText(CodeMirror.pos(start),
CodeMirror.pos(newEnd),
COLLAPSED);
}
updateSkipNum();
cm.focus();
}