diff --git a/Canvas.js b/Canvas.js index 7427ed5ff..fc29a3bdf 100644 --- a/Canvas.js +++ b/Canvas.js @@ -121,6 +121,7 @@ function newCanvas () { animation.addCallBackFunction('Chart Space Physics', thisObject.chartSpace.physics) animation.addCallBackFunction('CockpitSpace Physics', thisObject.cockpitSpace.physics) animation.addCallBackFunction('Strategy Space Physics', thisObject.strategySpace.physics) + animation.addCallBackFunction('Panels Space Physics', thisObject.panelsSpace.physics) animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw) animation.addCallBackFunction('Chart Space Background', thisObject.chartSpace.drawBackground) diff --git a/Panels/ProductsPanel.js b/Panels/ProductsPanel.js index 60e47534e..117b7e996 100644 --- a/Panels/ProductsPanel.js +++ b/Panels/ProductsPanel.js @@ -5,6 +5,7 @@ function newProductsPanel () { container: undefined, productCards: [], getLoadingProductCards: getLoadingProductCards, + physics: physics, draw: draw, getContainer: getContainer, // returns the inner most container that holds the point received by parameter. initialize: initialize @@ -232,6 +233,11 @@ function newProductsPanel () { } } + function physics () { + if (isInitialized === false) { return } + console.log('PHYSICS!!!') + } + function draw () { if (isInitialized === false) { return } diff --git a/Spaces/PanelsSpace.js b/Spaces/PanelsSpace.js index 04753532f..677bb486f 100644 --- a/Spaces/PanelsSpace.js +++ b/Spaces/PanelsSpace.js @@ -11,6 +11,7 @@ function newPanelsSpace () { createNewPanel: createNewPanel, destroyPanel: destroyPanel, getPanel: getPanel, + physics: physics, draw: draw, panels: [], getContainer: getContainer, // returns the inner most container that holds the point received by parameter. @@ -104,6 +105,19 @@ function newPanelsSpace () { } } + function physics () { + if (thisObject.visible !== true) { return } + + if (thisObject.panels !== undefined) { + for (let i = 0; i < thisObject.panels.length; i++) { + let panel = thisObject.panels[i] + if (panel.physics !== undefined) { + panel.physics() + } + } + } + } + function draw () { if (thisObject.visible !== true) { return }