mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-26 18:51:50 +02:00
Merge pull request #13118 from overleaf/mj-fix-centering-editable-graphics
[web] Always update centering in editablegraphics updateDOM GitOrigin-RevId: 366a109c2006dea3cd3660f7a380fbbc0e203cca
This commit is contained in:
committed by
Copybot
parent
379d5645b6
commit
e1a653eb10
@@ -19,19 +19,21 @@ export class EditableGraphicsWidget extends GraphicsWidget {
|
||||
}
|
||||
|
||||
updateDOM(element: HTMLImageElement, view: EditorView): boolean {
|
||||
this.destroyed = false
|
||||
element.classList.toggle('ol-cm-environment-centered', this.centered)
|
||||
if (
|
||||
this.filePath === element.dataset.filepath &&
|
||||
element.dataset.width === String(this.figureData?.width?.toString())
|
||||
) {
|
||||
// Figure remained the same, so just update the event listener on the button
|
||||
this.setEditDispatcher(
|
||||
element.querySelector('.ol-cm-graphics-edit-button')!,
|
||||
view
|
||||
const button = element.querySelector<HTMLButtonElement>(
|
||||
'.ol-cm-graphics-edit-button'
|
||||
)
|
||||
if (button) {
|
||||
this.setEditDispatcher(button, view)
|
||||
}
|
||||
return true
|
||||
}
|
||||
this.destroyed = false
|
||||
element.classList.toggle('ol-cm-environment-centered', this.centered)
|
||||
this.renderGraphic(element, view)
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user