mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Better support for array field key/value when either key or value is empty (fixes #1972)
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
* Auto-link a plugin/theme license in details if it starts with `http`
|
* Auto-link a plugin/theme license in details if it starts with `http`
|
||||||
* Allow to fallback to `docs:` instead of `readme:`
|
* Allow to fallback to `docs:` instead of `readme:`
|
||||||
* Forward a `sid` to GPM when downloading a premium package
|
* Forward a `sid` to GPM when downloading a premium package
|
||||||
|
* Better support for array field key/value when either key or value is empty [#1972](https://github.com/getgrav/grav-plugin-admin/issues/1972)
|
||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixed Safari issue with new ACL picker field [#1955](https://github.com/getgrav/grav-plugin-admin/issues/1955)
|
* Fixed Safari issue with new ACL picker field [#1955](https://github.com/getgrav/grav-plugin-admin/issues/1955)
|
||||||
* Stop propagation of ACL add button in ACL picker [flex-objects#83](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/83)
|
* Stop propagation of ACL add button in ACL picker [flex-objects#83](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/83)
|
||||||
|
|||||||
@@ -111,7 +111,13 @@ export default class ArrayField {
|
|||||||
let escaped_name = !template.isValueOnly() ? keyElement.val() : this.getIndexFor(element);
|
let escaped_name = !template.isValueOnly() ? keyElement.val() : this.getIndexFor(element);
|
||||||
escaped_name = escaped_name.toString().replace(/\[/g, '%5B').replace(/]/g, '%5D');
|
escaped_name = escaped_name.toString().replace(/\[/g, '%5B').replace(/]/g, '%5D');
|
||||||
let name = `${template.getName()}[${escaped_name}]`;
|
let name = `${template.getName()}[${escaped_name}]`;
|
||||||
valueElement.attr('name', !valueElement.val() ? template.getName() : name);
|
|
||||||
|
if (!template.isValueOnly() && (!keyElement.val() && !valueElement.val())) {
|
||||||
|
valueElement.attr('name', '');
|
||||||
|
} else {
|
||||||
|
// valueElement.attr('name', !valueElement.val() ? template.getName() : name);
|
||||||
|
valueElement.attr('name', name);
|
||||||
|
}
|
||||||
|
|
||||||
this.refreshNames(template);
|
this.refreshNames(template);
|
||||||
}
|
}
|
||||||
|
|||||||
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