mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 11:31:56 -05:00
d40de2018c
GitOrigin-RevId: de782d4b47d987f6434a34bea487568b269e8d85
13 lines
442 B
TypeScript
13 lines
442 B
TypeScript
import { EditorView } from '@codemirror/view'
|
|
|
|
/**
|
|
* An extension that triggers a custom DOM event whenever the editor geometry
|
|
* changes. This is used to synchronize the editor content and review panel
|
|
* height in "Current file" mode.
|
|
*/
|
|
export const geometryChangeEvent = () =>
|
|
EditorView.updateListener.of(update => {
|
|
if (update.geometryChanged) {
|
|
window.dispatchEvent(new CustomEvent('editor:geometry-change'))
|
|
}
|
|
})
|