This commit is contained in:
John Factotum
2023-03-11 22:04:42 +08:00
parent 99624d013a
commit 17ba85b0e5
+2 -2
View File
@@ -92,11 +92,11 @@ export class View {
const o = this.#getOverlayer(index) const o = this.#getOverlayer(index)
if (o) this.#drawAnnotation(o.doc, o.overlayer, annotation) if (o) this.#drawAnnotation(o.doc, o.overlayer, annotation)
const label = this.#tocProgress.getProgress(index)?.label ?? '' const label = this.#tocProgress.getProgress(index)?.label ?? ''
this?.emit({ type: 'add-annotation', annotation, label, index, position }) this.emit?.({ type: 'add-annotation', annotation, label, index, position })
}, },
onDelete: (key, index, position) => { onDelete: (key, index, position) => {
this.#getOverlayer(index)?.overlayer?.remove(key) this.#getOverlayer(index)?.overlayer?.remove(key)
this?.emit({ type: 'delete-annotation', index, position }) this.emit?.({ type: 'delete-annotation', index, position })
}, },
onUpdate: (annotation, index) => { onUpdate: (annotation, index) => {
const o = this.#getOverlayer(index) const o = this.#getOverlayer(index)