comparison Platforms/Wasm/wasm-application-runner.ts @ 314:97f16214dc5e am-2

cleanup
author am@osimis.io
date Wed, 03 Oct 2018 17:14:17 +0200
parents 8bdc6112bc2e
children e33659decec5
comparison
equal deleted inserted replaced
313:8bdc6112bc2e 314:97f16214dc5e
53 53
54 // function UpdateWebApplication(statusUpdateMessage: string) { 54 // function UpdateWebApplication(statusUpdateMessage: string) {
55 // console.log(statusUpdateMessage); 55 // console.log(statusUpdateMessage);
56 // } 56 // }
57 57
58 function _InitializeWasmApplication(canvasIds: string[], orthancBaseUrl: string): void { 58 function _InitializeWasmApplication(orthancBaseUrl: string): void {
59 59
60 CreateWasmApplication(); 60 CreateWasmApplication();
61 WasmWebService_SetBaseUri(orthancBaseUrl); 61 WasmWebService_SetBaseUri(orthancBaseUrl);
62 62
63 63
71 } 71 }
72 72
73 StartWasmApplication(); 73 StartWasmApplication();
74 74
75 // trigger a first resize of the canvas that have just been initialized 75 // trigger a first resize of the canvas that have just been initialized
76 for (let canvasId of canvasIds) { 76 Stone.WasmViewport.ResizeAll();
77 Stone.WasmViewport.GetFromCanvasId(canvasId).Resize();
78 }
79 77
80 UpdateContentThread(); 78 UpdateContentThread();
81 } 79 }
82 80
83 function InitializeWasmApplication(wasmModuleName: string, orthancBaseUrl: string, canvasIds: string[]) { 81 function InitializeWasmApplication(wasmModuleName: string, orthancBaseUrl: string) {
84 82
85 Stone.Framework.Configure(wasmModuleName); 83 Stone.Framework.Configure(wasmModuleName);
86 84
87 // Wait for the Orthanc Framework to be initialized (this initializes 85 // Wait for the Orthanc Framework to be initialized (this initializes
88 // the WebAssembly environment) and then, create and initialize the Wasm application 86 // the WebAssembly environment) and then, create and initialize the Wasm application
108 // Prevent scrolling 106 // Prevent scrolling
109 document.body.addEventListener('touchmove', function (event) { 107 document.body.addEventListener('touchmove', function (event) {
110 event.preventDefault(); 108 event.preventDefault();
111 }, false); 109 }, false);
112 110
113 _InitializeWasmApplication(canvasIds, orthancBaseUrl); 111 _InitializeWasmApplication(orthancBaseUrl);
114 }); 112 });
115 } 113 }