stable

Clone or download

Read-only

feat: Prevent browser to leave page during edition

When users start to edit an artidoc, the browser should ask them for confirmation before losing the current changes. The confirmation should be displayed as soon as there is at least one editor open. Took the opportunity to homogeneize the public api of useSectionEditor: instead of having a `cancelEditor()` and a `setEditMode(true)` we now have `cancelEditor()` and `enableEditor()`. Naming is more consistent and the parameter was always true publicly. Part of story #37543: edit Artidoc sections Change-Id: I3694e9da61ecded1d453bc6fec63818d153879e1

Modified Files

Name
M plugins/artidoc/scripts/artidoc/src/components/SectionEditorCta.test.ts +1 −1 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/components/SectionEditorCta.vue +2 −2 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/composables/useSectionEditor.test.ts +68 −3 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/composables/useSectionEditor.ts +26 −2 Go to diff View file
A plugins/artidoc/scripts/artidoc/src/helpers/on-before-unload.ts +30 −0 Go to diff View file