mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-06 21:35:49 +01:00
Array: When there's only one row, the minus sign clears values in the fields instead of doing nothing
This commit is contained in:
@@ -97,11 +97,13 @@
|
||||
};
|
||||
|
||||
ArrayField.prototype.remove = function(event) {
|
||||
if ($(event.target).closest('[data-grav-array-type="row"]').siblings().length == 0) {
|
||||
//disable for the last item
|
||||
var row = $(event.target).closest('[data-grav-array-type="row"]');
|
||||
if (row.siblings().length == 0) {
|
||||
//on the last item we just clear its values
|
||||
row.find('input').val('');
|
||||
return;
|
||||
}
|
||||
$(event.target).closest('[data-grav-array-type="row"]').remove();
|
||||
row.remove();
|
||||
if (this.isValueOnly()) {
|
||||
this.refreshAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user