Events childrenMouseOver taken from timelineCharts

This commit is contained in:
Luis Fernando Molina committed 2020-01-10 14:39:16 +01:00
1 parent abb09e18d8
commit d0c96d5b4b
3 files changed
+14 -5

No files matched your search

+11 -2
View File
@@ -77,8 +77,9 @@ function newTimeMachine () {
thisObject.container.eventHandler.stopListening(onMouseNotOverEventSuscriptionId)
for (let i = 0; i < thisObject.timelineCharts.length; i++) {
let chart = thisObject.timelineCharts[i]
chart.finalize()
let timelineChart = thisObject.timelineCharts[i]
timelineChart.container.eventHandler.stopListening(timelineChart.onChildrenMouseOverEventSuscriptionId)
timelineChart.finalize()
}
thisObject.timelineCharts = undefined
@@ -276,6 +277,7 @@ function newTimeMachine () {
let timelineChart = thisObject.timelineCharts[i]
if (timelineChart.syncWithDesignerLoop < syncWithDesignerLoop) {
/* Must be removed */
timelineChart.container.eventHandler.stopListening(timelineChart.onChildrenMouseOverEventSuscriptionId)
timelineChart.finalize()
timelineChartsMap.delete(timelineChart.nodeId)
thisObject.timelineCharts.splice(i, 1)
@@ -300,6 +302,13 @@ function newTimeMachine () {
timelineChart.container.frame.position.y = 0
timelineChart.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, timeLineCoordinateSystem, onTimelineChartInitialized)
/* we will store the event suscription id as a property of the timelineChart, to avoid keeping it an a separate array */
timelineChart.onChildrenMouseOverEventSuscriptionId = timelineChart.container.eventHandler.listenToEvent('onChildrenMouseOver', onChildrenMouseOver)
function onChildrenMouseOver (event) {
thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
}
function onTimelineChartInitialized (err) {
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
if (ERROR_LOG === true) { logger.write('[ERROR] syncWithDesigner -> initializeTimelineChart -> Initialization Failed. -> Err ' + err.message) }
+2 -2
View File
@@ -178,6 +178,7 @@ function newTimelineChart () {
onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
function onMouseOver (event) {
/* This event gets to the timelinechart container because it inherits it from the time machine container, which is the one raising Mouse Over and Mouse not Over Events to its children. */
if (thisObject.timeFrameScale !== undefined) {
thisObject.timeFrameScale.visible = true
thisObject.timeFrameScale.onMouseOverSomeTimeMachineContainer(event)
@@ -225,8 +226,7 @@ function newTimelineChart () {
timeFrameScaleMouseOverEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('onMouseOver', timeFrameScaleMouseOver)
function timeFrameScaleMouseOver (event) {
mouse.position.x = event.x
mouse.position.y = event.y
thisObject.container.eventHandler.raiseEvent('onChildrenMouseOver', event)
saveUserPosition(thisObject.container, timeLineCoordinateSystem, event)
}
+1 -1
View File
@@ -17,7 +17,7 @@ function newTimeScale () {
}
const LENGHT_PERCENTAGE_DEFAULT_VALUE = 5
const STEP_SIZE = 2.5
const STEP_SIZE = 1
thisObject.container = newContainer()
thisObject.container.initialize(MODULE_NAME)