mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-07 22:05:59 +01:00
Should not be able to delete last empty array field. Fixes #145
This commit is contained in:
@@ -93,6 +93,10 @@
|
||||
};
|
||||
|
||||
ArrayField.prototype.remove = function(event) {
|
||||
if ($(event.target).closest('[data-grav-array-type="row"]').siblings().length == 0) {
|
||||
//disable for the last item
|
||||
return;
|
||||
}
|
||||
$(event.target).closest('[data-grav-array-type="row"]').remove();
|
||||
if (this.isValueOnly()) {
|
||||
this.refreshAll();
|
||||
|
||||
Reference in New Issue
Block a user