diff Platforms/WebAssembly/wasm-application.js @ 229:b0ba3b38a23c am

ScheduleRedraw can handle multiple viewports
author am@osimis.io
date Thu, 14 Jun 2018 16:51:43 +0200
parents 210c1ce8e1a6
children
line wrap: on
line diff
--- a/Platforms/WebAssembly/wasm-application.js	Thu Jun 14 15:06:29 2018 +0200
+++ b/Platforms/WebAssembly/wasm-application.js	Thu Jun 14 16:51:43 2018 +0200
@@ -4,7 +4,6 @@
 var viewport = null;
 var WasmWebService_NotifyError = null;
 var WasmWebService_NotifySuccess = null;
-//var NotifyRestApiGet = null;
 var NotifyUpdateContent = null;
 
 function UpdateContentThread()
@@ -62,7 +61,7 @@
                                  
   console.log("Creating main viewport");
 
-  viewport = new Stone.WasmViewport(StoneFrameworkModule, 'canvas');
+  viewport = new Stone.WasmViewport(StoneFrameworkModule, canvasId);
   viewport.Initialize(CreateCppViewport());
 
   // Prevent scrolling
@@ -70,7 +69,7 @@
     event.preventDefault();
   }, false);
   
-  document.getElementById('canvas').onclick = function() {
+  document.getElementById(canvasId).onclick = function() {
     viewport.Redraw();
   };