Skip to content

Commit ad4a011

Browse files
support right-copy in timetable editor
1 parent 1efb3f0 commit ad4a011

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

i18n/english.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,7 @@ components:
13991399
- New trip
14001400
- Clone selected trip(s)
14011401
- Copy time value from adjacent cell (the cell immediately to the left)
1402+
- Copy time value from adjacent cell (the cell immediately to the right)
14021403
- Copy value from cell directly above
14031404
title: Timetable editor keyboard shortcuts
14041405
TimezoneSelect:

lib/editor/components/timetable/TimetableGrid.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ export default class TimetableGrid extends Component<Props> {
205205
}
206206
break
207207
}
208+
case 76: { // l
209+
// Set current cell's value to adjacent cell's (rightward) value.
210+
const adjacentCol = columns[this._getColIndex(scrollToColumn) + 1]
211+
if (evt.shiftKey && !activeCell && isTimeFormat(adjacentCol.type)) {
212+
const value = objectPath.get(data[scrollToRow], adjacentCol.key)
213+
this._handleCellChange(value, scrollToRow, col, scrollToColumn)
214+
this.offsetScrollCol(-1)
215+
return false
216+
}
217+
break
218+
}
208219
case 186: { // semi-colon
209220
// Set current cell's value to above cell's value.
210221
const previousRowIndex = scrollToRow - 1

lib/editor/util/timetable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { EXCEPTION_EXEMPLARS } from '.'
1212
export const SHORTCUTS = {
1313
offset: ['o', 'SHIFT:+:o', 'i', 'SHIFT:+:i', '-', 'SHIFT:+:-', '+', 'SHIFT:+:+'],
1414
navigate: ['k:/:j', '←:/:→', 'x', 'a', 'd'],
15-
modify: ['#', 'n', 'c', 'SHIFT:+:\'', 'SHIFT:+:;']
15+
modify: ['#', 'n', 'c', 'SHIFT:+:\'', 'SHIFT:+:l', 'SHIFT:+:;']
1616
}
1717

1818
/**

0 commit comments

Comments
 (0)