Resize of browser is handled. Fix #31
This commit is contained in:
1 parent
fb164af205
commit
7b49e0f522
12 files changed
+142
-29
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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); }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -224,9 +224,6 @@
|
||||
<Compile Include="ViewPort.js" />
|
||||
<Compile Include="VolumeBar.js" />
|
||||
<Content Include="index.html" />
|
||||
<Content Include="Json.json">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="Server\Exchange\Wrappers\binanceProperties.json" />
|
||||
<Content Include="Server\Exchange\Wrappers\poloniexProperties.json" />
|
||||
<Content Include="this.server.config.json" />
|
||||
|
||||
+15
-6
@@ -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) {
|
||||
|
||||
+12
-3
@@ -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);
|
||||
|
||||
+10
-2
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
+10
-2
@@ -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() {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<script type="text/javascript" src="Scripts/AppPreLoader.js"></script>
|
||||
|
||||
</head>
|
||||
<body id="body" style="margin: 0px; padding: 0px; border: 0px; overflow:hidden;" onload="
|
||||
<body id="body" style="margin: 0px; padding: 0px; border: 0px; overflow:hidden;" onresize="window.canvasApp.eventHandler.raiseEvent('Browser Resized');" onload="
|
||||
|
||||
window.canvasApp = {
|
||||
sessionToken: '',
|
||||
|
||||
Reference in new issue
Block a user