Improvement arrow keys to move charts

This commit is contained in:
Luis Fernando Molina committed 2020-03-02 15:10:00 +01:00
1 parent df176c3a18
commit d4f6394a52
5 files changed
+72 -15

No files matched your search

+11
View File
@@ -19,6 +19,7 @@ function newChartingSpace () {
timeMachines: undefined,
viewport: undefined,
payload: undefined,
onKeyPressed: onKeyPressed,
reset: reset,
oneScreenUp: oneScreenUp,
oneScreenDown: oneScreenDown,
@@ -263,6 +264,16 @@ function newChartingSpace () {
syncWithDesigner()
}
function onKeyPressed (event) {
if (thisObject.visible !== true) { return }
for (let j = 0; j < thisObject.timeMachines.length; j++) {
let timeMachine = thisObject.timeMachines[j]
if (timeMachine.onFocus === true) {
timeMachine.onKeyPressed(event)
}
}
}
function syncWithDesigner () {
if (thisObject.payload === undefined) { return }
if (thisObject.payload.node === undefined) { return }