mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-04-09 06:08:49 +02:00
Prevent Save actions from Flex Objects to trigger the unsaved unload notice (fixes #2125)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
2
themes/grav/js/admin.min.js
vendored
2
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user