Note tab added

This commit is contained in:
2018-08-10 23:16:26 +02:00
parent c952798e66
commit b1d1fa4880
8 changed files with 273 additions and 119 deletions
+16
View File
@@ -485,6 +485,8 @@ class Changeset
else {
$this->removedColumns[] = $id;
}
$this->clearColumnOrderIfUnchanged();
}
public function columnRestore(string $id)
@@ -610,6 +612,7 @@ class Changeset
$missing = array_diff($ids, $order);
$this->columnOrder = array_merge($order, $missing);
$this->clearColumnOrderIfUnchanged();
}
public function removeEmptyNewRows()
@@ -634,4 +637,17 @@ class Changeset
return false;
});
}
public function clearColumnOrderIfUnchanged()
{
$expected = collect($this->revision->columns)
->pluck('id')
->diff($this->removedColumns)
->merge(collect($this->newColumns)->pluck('id'))
->all();
if ($expected == $this->columnOrder) {
$this->columnOrder = [];
}
}
}