Fixed Save Shortcut (CTRL + S / CMD + S) not working with new Flex Pages (fixes #1787)

This commit is contained in:
Djamil Legato
2019-12-04 12:33:14 -08:00
parent 9e9dfce8be
commit 56832a5fba
4 changed files with 9 additions and 5 deletions

View File

@@ -11,6 +11,7 @@
* Translations: rename MODULAR to MODULE everywhere
1. [](#bugfix)
* Fixed `permissions` field with nested permissions
* Fixed Save Shortcut (CTRL + S / CMD + S) not working with new Flex Pages [#1787](https://github.com/getgrav/grav-plugin-admin/issues/1787)
# v1.10.0-rc.1
## 11/06/2019

View File

@@ -31,7 +31,7 @@ export default class Form {
_attachShortcuts() {
// CTRL + S / CMD + S - shortcut for [Save] when available
let saveTask = $('#titlebar [name="task"][value="save"]');
let saveTask = $('#titlebar [name="task"][value="save"][form="blueprints"]');
if (saveTask.length) {
$(global).on('keydown', function(event) {

View File

@@ -12,8 +12,11 @@ $(document).on('click', '[data-page-move] button[name="task"][value="save"]', (e
}*/
const modal = $(event.currentTarget).closest('[data-remodal-id]');
const parents = modal.data('parents');
const parents = modal.data('parents') || {};
const finder = parents.finder;
if (!parents || !finder) { return true; }
const field = parents.field;
const parentLabel = parents.parentLabel;
const parentName = parents.parentName;

File diff suppressed because one or more lines are too long