Column: remove moveAfter
This commit is contained in:
@@ -148,13 +148,13 @@ namespace Actions {
|
||||
|
||||
case "column-move-start": return () => {
|
||||
world.doIfTiledFocused(true, (clientManager, desktopManager, window, column, grid) => {
|
||||
column.moveAfter(null);
|
||||
grid.moveColumn(column, null);
|
||||
});
|
||||
};
|
||||
|
||||
case "column-move-end": return () => {
|
||||
world.doIfTiledFocused(true, (clientManager, desktopManager, window, column, grid) => {
|
||||
column.moveAfter(grid.getLastColumn());
|
||||
grid.moveColumn(column, grid.getLastColumn());
|
||||
});
|
||||
};
|
||||
|
||||
@@ -287,9 +287,9 @@ namespace Actions {
|
||||
return;
|
||||
}
|
||||
if (targetColumn.isAfter(column)) {
|
||||
column.moveAfter(targetColumn);
|
||||
grid.moveColumn(column, targetColumn);
|
||||
} else {
|
||||
column.moveAfter(grid.getPrevColumn(targetColumn));
|
||||
grid.moveColumn(column, grid.getPrevColumn(targetColumn));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -30,13 +30,6 @@ class Column {
|
||||
}
|
||||
}
|
||||
|
||||
public moveAfter(prevColumn: Column|null) {
|
||||
if (prevColumn === this) {
|
||||
return;
|
||||
}
|
||||
this.grid.moveColumn(this, prevColumn);
|
||||
}
|
||||
|
||||
public isAfter(other: Column) {
|
||||
return this.gridX > other.gridX;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class Grid {
|
||||
}
|
||||
|
||||
public moveColumn(column: Column, prevColumn: Column|null) {
|
||||
if (column === prevColumn) {
|
||||
return;
|
||||
}
|
||||
const movedLeft = prevColumn === null ? true : column.isAfter(prevColumn);
|
||||
const firstMovedColumn = movedLeft ? column : this.getNextColumn(column);
|
||||
this.columns.move(column, prevColumn);
|
||||
|
||||
Reference in New Issue
Block a user