Column: rename isToTheLeftOf and isToTheRightOf
This commit is contained in:
@@ -286,7 +286,7 @@ namespace Actions {
|
||||
if (targetColumn === null || targetColumn === column) {
|
||||
return;
|
||||
}
|
||||
if (targetColumn.isAfter(column)) {
|
||||
if (targetColumn.isToTheRightOf(column)) {
|
||||
grid.moveColumn(column, targetColumn);
|
||||
} else {
|
||||
grid.moveColumn(column, grid.getPrevColumn(targetColumn));
|
||||
|
||||
@@ -30,12 +30,12 @@ class Column {
|
||||
}
|
||||
}
|
||||
|
||||
public isAfter(other: Column) {
|
||||
return this.gridX > other.gridX;
|
||||
public isToTheLeftOf(other: Column) {
|
||||
return this.gridX < other.gridX;
|
||||
}
|
||||
|
||||
public isBefore(other: Column) {
|
||||
return this.gridX < other.gridX;
|
||||
public isToTheRightOf(other: Column) {
|
||||
return this.gridX > other.gridX;
|
||||
}
|
||||
|
||||
public moveWindowUp(window: Window) {
|
||||
|
||||
@@ -28,7 +28,7 @@ class Grid {
|
||||
if (column === prevColumn) {
|
||||
return;
|
||||
}
|
||||
const movedLeft = prevColumn === null ? true : column.isAfter(prevColumn);
|
||||
const movedLeft = prevColumn === null ? true : column.isToTheRightOf(prevColumn);
|
||||
const firstMovedColumn = movedLeft ? column : this.getNextColumn(column);
|
||||
this.columns.move(column, prevColumn);
|
||||
this.columnsSetX(firstMovedColumn);
|
||||
|
||||
Reference in New Issue
Block a user