Skip to content

Commit 31598d3

Browse files
author
Friedrich W. H. Kossebau
committed
Workaround AnnotationViewManager not fixing cursor pos after highlighting
1 parent f632956 commit 31598d3

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

webodf/lib/ops/OdtDocument.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
119119
}
120120
initialDoc = rootElement.cloneNode(true);
121121
odfCanvas.refreshAnnotations();
122+
// workaround AnnotationViewManager not fixing up cursor positions after creating the highlighting
123+
self.fixCursorPositions();
122124
return initialDoc;
123125
};
124126

webodf/lib/ops/OpRemoveAnnotation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ ops.OpRemoveAnnotation = function OpRemoveAnnotation() {
9292
// The specified position is the first walkable step in the annotation. The position is always just before the first point of change
9393
odtDocument.emit(ops.OdtDocument.signalStepsRemoved, {position: position > 0 ? position - 1 : position});
9494

95-
odtDocument.fixCursorPositions();
9695
odtDocument.getOdfCanvas().refreshAnnotations();
96+
// workaround AnnotationViewManager not fixing up cursor positions after creating the highlighting
97+
odtDocument.fixCursorPositions();
9798
return true;
9899
};
99100

0 commit comments

Comments
 (0)