(dir, loop)
| 1094 | } |
| 1095 | |
| 1096 | switchLinear(dir, loop) { |
| 1097 | let index = this.selectedIndex(); |
| 1098 | let column = this[index]; |
| 1099 | if (!column) |
| 1100 | return false; |
| 1101 | let row = column.indexOf(this.selectedWindow); |
| 1102 | if (Lib.in_bounds(column, row + dir) === false) { |
| 1103 | index += dir; |
| 1104 | if (loop) { |
| 1105 | if (index >= this.length) { |
| 1106 | index = 0; |
| 1107 | } else if (index < 0) { |
| 1108 | index = this.length - 1; |
| 1109 | } |
| 1110 | } |
| 1111 | if (dir === 1) { |
| 1112 | if (index < this.length) |
| 1113 | row = 0; |
| 1114 | } else if (index >= 0) |
| 1115 | row = this[index].length - 1; |
| 1116 | } else { |
| 1117 | row += dir; |
| 1118 | } |
| 1119 | |
| 1120 | let metaWindow = this.getWindow(index, row); |
| 1121 | ensureViewport(metaWindow, this); |
| 1122 | return true; |
| 1123 | } |
| 1124 | |
| 1125 | switchLeft(loop) { return this.switch(Meta.MotionDirection.LEFT, loop); } |
| 1126 | switchRight(loop) { return this.switch(Meta.MotionDirection.RIGHT, loop); } |
no test coverage detected