Skip to content

Commit

Permalink
Fix the module worker demo
Browse files Browse the repository at this point in the history
Closes #6388.
  • Loading branch information
satrujit11 authored Feb 23, 2021
1 parent 5f626a1 commit c8cc183
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions demos/workers/modules/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</label>
</p>

<canvas id="output"></canvas>
<div id="output"></div>

<script type="module">
const worker = new Worker("worker.js", { type: "module" });
Expand All @@ -46,8 +46,6 @@
img.src = url.value;

img.onload = () => {
output.innerHTML = "";

const canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
Expand All @@ -57,7 +55,7 @@
imageData = context.getImageData(0, 0, canvas.width, canvas.height);

sendToWorker();
output.appendChild(canvas);
output.replaceChildren(canvas);
};
}

Expand Down
1 change: 1 addition & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -123929,6 +123929,7 @@ INSERT INTERFACES HERE
Sanjoy Pal,
Sarah Gebauer,
Sarven Capadisli,
Satrujit Behera,
Schalk Neethling,
Scott Beardsley,
Scott Gonz&aacute;lez,
Expand Down

0 comments on commit c8cc183

Please sign in to comment.