Prevent Save actions from Flex Objects to trigger the unsaved unload notice (fixes #2125)

This commit is contained in:
Djamil Legato
2021-04-20 10:42:30 -07:00
parent ecbfda8681
commit a2fe02bb0a
3 changed files with 3 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* Moved preset CSS compile to earlier in the process to ensure compilation happens in time.
* Prevent Save actions from Flex Objects to trigger the unsaved unload notice [#2125](https://github.com/getgrav/grav-plugin-admin/issues/2125)
# v1.10.12
## 04/15/2021

View File

@@ -12,7 +12,7 @@ const DOMBehaviors = {
},
preventUnload() {
let selector = '[name="task"][value^="save"], [data-delete-action]';
let selector = '[name="task"][value^="save"], [data-delete-action], [data-flex-safe-action]';
if ($._data(window, 'events') && ($._data(window, 'events').beforeunload || []).filter((event) => event.namespace === '_grav').length) {
return;
}

File diff suppressed because one or more lines are too long