Grid: rename moveColumn
This commit is contained in:
@@ -19,7 +19,7 @@ class Column {
|
|||||||
|
|
||||||
public moveToGrid(targetGrid: Grid, prevColumn: Column|null) {
|
public moveToGrid(targetGrid: Grid, prevColumn: Column|null) {
|
||||||
if (targetGrid === this.grid) {
|
if (targetGrid === this.grid) {
|
||||||
this.grid.onColumnMoved(this, prevColumn);
|
this.grid.moveColumn(this, prevColumn);
|
||||||
} else {
|
} else {
|
||||||
this.grid.onColumnRemoved(this, false);
|
this.grid.onColumnRemoved(this, false);
|
||||||
this.grid = targetGrid;
|
this.grid = targetGrid;
|
||||||
@@ -34,7 +34,7 @@ class Column {
|
|||||||
if (prevColumn === this) {
|
if (prevColumn === this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.grid.onColumnMoved(this, prevColumn);
|
this.grid.moveColumn(this, prevColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public isAfter(other: Column) {
|
public isAfter(other: Column) {
|
||||||
|
|||||||
@@ -24,6 +24,15 @@ class Grid {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public moveColumn(column: Column, prevColumn: Column|null) {
|
||||||
|
const movedLeft = prevColumn === null ? true : column.isAfter(prevColumn);
|
||||||
|
const firstMovedColumn = movedLeft ? column : this.getNextColumn(column);
|
||||||
|
this.columns.move(column, prevColumn);
|
||||||
|
this.columnsSetX(firstMovedColumn);
|
||||||
|
this.desktop.onLayoutChanged();
|
||||||
|
this.desktop.autoAdjustScroll();
|
||||||
|
}
|
||||||
|
|
||||||
public moveColumnLeft(column: Column) {
|
public moveColumnLeft(column: Column) {
|
||||||
this.columns.moveBack(column);
|
this.columns.moveBack(column);
|
||||||
this.columnsSetX(column);
|
this.columnsSetX(column);
|
||||||
@@ -180,15 +189,6 @@ class Grid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public onColumnMoved(column: Column, prevColumn: Column|null) {
|
|
||||||
const movedLeft = prevColumn === null ? true : column.isAfter(prevColumn);
|
|
||||||
const firstMovedColumn = movedLeft ? column : this.getNextColumn(column);
|
|
||||||
this.columns.move(column, prevColumn);
|
|
||||||
this.columnsSetX(firstMovedColumn);
|
|
||||||
this.desktop.onLayoutChanged();
|
|
||||||
this.desktop.autoAdjustScroll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public onColumnWidthChanged(column: Column) {
|
public onColumnWidthChanged(column: Column) {
|
||||||
const nextColumn = this.columns.getNext(column);
|
const nextColumn = this.columns.getNext(column);
|
||||||
this.columnsSetX(nextColumn);
|
this.columnsSetX(nextColumn);
|
||||||
|
|||||||
Reference in New Issue
Block a user