annotation: scroll to comment after resize comment list section
Signed-off-by: Pranam Lashkari <lpranam@collabora.com> Change-Id: Icbabf5dcdb6f1e01ca0271b2898df28f11810f35pull/8807/head
parent
bac4161583
commit
81b00e7376
|
@ -691,7 +691,7 @@ export class CommentSection extends CanvasSectionObject {
|
|||
}
|
||||
|
||||
public select (annotation: Comment, force: boolean = false): void {
|
||||
if (force || (annotation && !annotation.pendingInit && annotation !== this.sectionProperties.selectedComment)) {
|
||||
if (annotation && ((!annotation.pendingInit && annotation !== this.sectionProperties.selectedComment) || force)) {
|
||||
// Unselect first if there anything selected.
|
||||
if (this.sectionProperties.selectedComment)
|
||||
this.unselect();
|
||||
|
@ -1727,6 +1727,7 @@ export class CommentSection extends CanvasSectionObject {
|
|||
if (app.view.size.pixels[1] !== lastY) {
|
||||
app.view.size.pixels[1] = lastY;
|
||||
this.onResize(); // Annotation goes beyond document and can't be scrolled further unless resized
|
||||
this.select(this.sectionProperties.selectedComment, true); // Reselecting will bring entire comment in view
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue