mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-07 22:05:59 +01:00
Fix #304, saving array fields
This commit is contained in:
@@ -98,12 +98,20 @@
|
||||
|
||||
ArrayField.prototype.remove = function(event) {
|
||||
var row = $(event.target).closest('[data-grav-array-type="row"]');
|
||||
var lastItem = false;
|
||||
|
||||
if (row.siblings().length == 0) {
|
||||
//on the last item we just clear its values
|
||||
row.find('input').val('');
|
||||
return;
|
||||
lastItem = true;
|
||||
this.add(event);
|
||||
}
|
||||
|
||||
row.remove();
|
||||
|
||||
if (lastItem == true) {
|
||||
this.refreshAll();
|
||||
}
|
||||
|
||||
if (this.isValueOnly()) {
|
||||
this.refreshAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user