diff --git a/resources/assets/js/components/RowsEditor.vue b/resources/assets/js/components/RowsEditor.vue index 7ceb3ad..e4eee85 100644 --- a/resources/assets/js/components/RowsEditor.vue +++ b/resources/assets/js/components/RowsEditor.vue @@ -26,14 +26,14 @@ Rows are identified by row._id, columns by col.id
- +
CSV + -->From CSV
@@ -43,8 +43,13 @@ Rows are identified by row._id, columns by col.id
- + + @@ -316,9 +321,15 @@ Rows are identified by row._id, columns by col.id /** Save all changed rows */ saveAllChanges () { let toChange = _.filter(this.rows, (r) => { - return this.isRowChanged(r) + let changed = this.isRowChanged(r) + if (!changed && r._editing) { + this.rows[r._id]._editing = false + } + return changed; }) + if (toChange.length === 0) return; + this.query({ action: 'row.update-many', data: toChange @@ -349,7 +360,13 @@ Rows are identified by row._id, columns by col.id this.$set(this.rows, row._id, row) if (wasDirty) this.dirtyRows-- + }, + + editAll() { + _.each(this.rows, (row, id) => { + this.$set(this.rows[id], '_editing', true) + }) } - } + }, }