diff --git a/BottomSpace/ChartAspectRatio.js b/BottomSpace/ChartAspectRatio.js index d879bc11b..c448a872e 100644 --- a/BottomSpace/ChartAspectRatio.js +++ b/BottomSpace/ChartAspectRatio.js @@ -14,8 +14,7 @@ thisObject.container.frame.width = 50; thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width ; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize(); container.isDraggeable = false; container.isClickeable = false; @@ -48,6 +47,15 @@ thisObject.container.eventHandler.listenToEvent('Mouse Wheel', onMouseWheel); + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + + } + + function resize() { + + container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + } function onMouseWheel(pDelta) { diff --git a/BottomSpace/DeleteTradingHistory.js b/BottomSpace/DeleteTradingHistory.js index c1b49b096..f57c08f1f 100644 --- a/BottomSpace/DeleteTradingHistory.js +++ b/BottomSpace/DeleteTradingHistory.js @@ -21,8 +21,7 @@ function newDeleteTradingHistory() { thisObject.container.frame.width = 50; thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize(); container.isDraggeable = false; container.isClickeable = true; @@ -50,15 +49,26 @@ function newDeleteTradingHistory() { thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick); + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + if (callBackFunction !== undefined) { callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE); } } catch (err) { if (ERROR_LOG === true) { logger.write("[ERROR] initialize -> err.message = " + err.message); } if (callBackFunction !== undefined) { callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE); } - } + } + } + function resize() { + + container.frame.position.x = viewPort.visibleArea.topRight.x; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + + } + + function onClick() { try { diff --git a/BottomSpace/PlayStopButton.js b/BottomSpace/PlayStopButton.js index c70935360..413523076 100644 --- a/BottomSpace/PlayStopButton.js +++ b/BottomSpace/PlayStopButton.js @@ -16,8 +16,7 @@ function newPlayStopButton() { thisObject.container.frame.width = 50; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = (viewPort.visibleArea.topRight.x - viewPort.visibleArea.topLeft.x) / 2 - 10; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize(); container.isDraggeable = false; container.isClickeable = true; @@ -55,8 +54,18 @@ function newPlayStopButton() { viewPort.eventHandler.listenToEvent("Zoom Changed", onZoomChanged); timePeriod = INITIAL_TIME_PERIOD; + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + } + function resize() { + + container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 4; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + + } + + function onClick() { let sessionToken = window.localStorage.getItem('sessionToken'); diff --git a/Dashboard.js b/Dashboard.js index 203941361..9e8a3b952 100644 --- a/Dashboard.js +++ b/Dashboard.js @@ -34,6 +34,7 @@ function newDashboard() { window.canvasApp.eventHandler = newEventHandler(); window.canvasApp.eventHandler.listenToEvent("User Profile Changed", userProfileChanged); + window.canvasApp.eventHandler.listenToEvent("Browser Resized", browserResized); /* Next we start the App*/ @@ -90,6 +91,44 @@ function newDashboard() { } } + + function browserResized() { + + try { + + if (INFO_LOG === true) { logger.write("[INFO] browserResized -> Entering function."); } + + console.log("windows resized"); + + browserCanvas = document.getElementById('canvas'); + + browserCanvas.width = window.innerWidth; + browserCanvas.height = window.innerHeight - window.canvasApp.topMargin; + + viewPort.initialize(); + + + //canvas.topSpace.initialize(); + //canvas.bottomSpace.resize(); + //canvas.panelsSpace.initialize(); + + + + /* + canvas.floatingSpace.initialize(); + canvas.chartSpace.initialize(onCharSpaceInitialized); + + function onCharSpaceInitialized() { + + } + */ + } catch (err) { + + if (ERROR_LOG === true) { logger.write("[ERROR] browserResized -> err = " + err); } + + } + + } } diff --git a/Project.njsproj b/Project.njsproj index c20eeb473..55cc2656d 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -224,9 +224,6 @@ - - Code - diff --git a/Spaces/BottomSpace.js b/Spaces/BottomSpace.js index b262752cd..8343de863 100644 --- a/Spaces/BottomSpace.js +++ b/Spaces/BottomSpace.js @@ -15,14 +15,10 @@ function newBottomSpace() { container.initialize(); thisObject.container = container; - thisObject.container.frame.width = browserCanvas.width; - thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT; - - container.frame.position.x = 0; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; - container.isDraggeable = false; + resize(); + return thisObject; function initialize() { @@ -35,6 +31,19 @@ function newBottomSpace() { thisObject.playStopButton = newPlayStopButton(); thisObject.playStopButton.initialize(); + + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + + } + + function resize() { + + container.frame.position.x = 0; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + + thisObject.container.frame.width = browserCanvas.width; + thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT; + } function getContainer(point) { diff --git a/SplashScreen.js b/SplashScreen.js index 8038ca0af..6a0f249fa 100644 --- a/SplashScreen.js +++ b/SplashScreen.js @@ -19,8 +19,7 @@ function newSplashScreen() { container.initialize(); thisObject.container = container; - thisObject.container.frame.width = browserCanvas.width; - thisObject.container.frame.height = browserCanvas.height; + resize(); container.displacement.containerName = "Splash Screen"; container.frame.containerName = "Splash Screen"; @@ -51,8 +50,18 @@ function newSplashScreen() { logo.src = window.canvasApp.urlPrefix + "Images/aa-logo.png"; + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + } + function resize() { + + thisObject.container.frame.width = browserCanvas.width; + thisObject.container.frame.height = browserCanvas.height; + + } + + function draw() { if (splashScreenNeeded === false) { @@ -64,7 +73,7 @@ function newSplashScreen() { if (fadeOutCounter > 20) { return; } - opacity = opacity - 0.05; + opacity = opacity - 0.1; } thisObject.container.frame.draw(false, false); diff --git a/TopSpace/CurrentBot.js b/TopSpace/CurrentBot.js index 27f9349c8..8961c6ab6 100644 --- a/TopSpace/CurrentBot.js +++ b/TopSpace/CurrentBot.js @@ -15,8 +15,7 @@ function newCurrentBot() { thisObject.container.frame.width = 150; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 1; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize(); container.isDraggeable = false; container.isClickeable = true; @@ -48,6 +47,15 @@ function newCurrentBot() { thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick); sharedStatus.eventHandler.listenToEvent("devTeam Changed", onDevTeamChanged); + + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + } + + function resize() { + + container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 1; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + } function onDevTeamChanged() { diff --git a/TopSpace/CurrentProcess.js b/TopSpace/CurrentProcess.js index 0e965d98b..9b6693bb0 100644 --- a/TopSpace/CurrentProcess.js +++ b/TopSpace/CurrentProcess.js @@ -15,8 +15,7 @@ function newCurrentProcess() { thisObject.container.frame.width = 150; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 2; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize() container.isDraggeable = false; container.isClickeable = true; @@ -51,6 +50,15 @@ function newCurrentProcess() { thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick); sharedStatus.eventHandler.listenToEvent("userBot Changed", onUserBotChanged); + + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + } + + function resize() { + + container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 2; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + } function onUserBotChanged() { diff --git a/TopSpace/CurrentStartMode.js b/TopSpace/CurrentStartMode.js index ef52b4687..619b3ef39 100644 --- a/TopSpace/CurrentStartMode.js +++ b/TopSpace/CurrentStartMode.js @@ -15,8 +15,7 @@ function newCurrentStartMode() { thisObject.container.frame.width = 150; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 3; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize(); container.isDraggeable = false; container.isClickeable = true; @@ -32,6 +31,15 @@ function newCurrentStartMode() { } thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick); + + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + } + + function resize() { + + container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 3; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + } function onClick() { @@ -92,7 +100,7 @@ function newCurrentStartMode() { } if (window.CURRENT_BOT_DISPLAY_NAME === "") { return;} - + label = "Competition"; thisObject.container.frame.draw(false, false); let fontSize = 12; diff --git a/TopSpace/DevTeam.js b/TopSpace/DevTeam.js index 640b3d9c6..36ef36aeb 100644 --- a/TopSpace/DevTeam.js +++ b/TopSpace/DevTeam.js @@ -15,8 +15,7 @@ function newDevTeam() { thisObject.container.frame.width = 150; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 0; - container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + resize(); container.isDraggeable = false; container.isClickeable = true; @@ -54,6 +53,15 @@ function newDevTeam() { } thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick); + + window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize); + } + + function resize() { + + container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 0; + container.frame.position.y = viewPort.visibleArea.bottomLeft.y; + } function onClick() { diff --git a/index.html b/index.html index fc97523a3..0c711fc40 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ -