From 6f1f85b1943e09eb61188f60bd7e6164ee660a5e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 10 Jan 2020 15:17:05 +0100 Subject: [PATCH] bug fixed turning off scales when switching focus --- ChartsSpace/TimeMachine.js | 11 ----------- ChartsSpace/TimelineChart.js | 1 + Spaces/ChartSpace.js | 9 ++++++++- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ChartsSpace/TimeMachine.js b/ChartsSpace/TimeMachine.js index 107f09648..e193efcab 100644 --- a/ChartsSpace/TimeMachine.js +++ b/ChartsSpace/TimeMachine.js @@ -217,17 +217,6 @@ function newTimeMachine () { if (thisObject.container.frame.isThisPointHere(point) === true) { return thisObject.container - } else { - if (purpose === GET_CONTAINER_PURPOSE.MOUSE_OVER) { - thisObject.container.eventHandler.raiseEvent('onMouseNotOver') - if (thisObject.timeScale !== undefined) { - thisObject.timeScale.visible = false - } - if (thisObject.rateScale !== undefined) { - thisObject.rateScale.visible = false - } - } - return } } diff --git a/ChartsSpace/TimelineChart.js b/ChartsSpace/TimelineChart.js index 7e68224e4..7a7296485 100644 --- a/ChartsSpace/TimelineChart.js +++ b/ChartsSpace/TimelineChart.js @@ -193,6 +193,7 @@ function newTimelineChart () { onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver) function onMouseNotOver (event) { + /* This event is inherited from the Time Machine */ if (thisObject.timeFrameScale !== undefined) { thisObject.timeFrameScale.visible = false } diff --git a/Spaces/ChartSpace.js b/Spaces/ChartSpace.js index 6500bd1db..7f4fcca26 100644 --- a/Spaces/ChartSpace.js +++ b/Spaces/ChartSpace.js @@ -70,8 +70,15 @@ function newChartSpace () { let container - /* Now we see which is the inner most container that has it */ + /* This first step is not actually to get the container but to allow things to be turned off in case there is a switch of focus from one time machine to another */ + for (let i = 0; i < thisObject.timeMachines.length; i++) { + container = thisObject.timeMachines[i].container + if (purpose === GET_CONTAINER_PURPOSE.MOUSE_OVER) { + container.eventHandler.raiseEvent('onMouseNotOver') + } + } + /* Now we see which is the inner most container that has it */ for (let i = 0; i < thisObject.timeMachines.length; i++) { container = thisObject.timeMachines[i].getContainer(point, purpose) if (container !== undefined) {