Skip to content

Commit

Permalink
clear button removes answer as well now
Browse files Browse the repository at this point in the history
  • Loading branch information
RusFortunat committed Nov 15, 2024
1 parent aafd5c8 commit 8e41601
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file modified src/main/resources/image-database.mv.db
Binary file not shown.
6 changes: 4 additions & 2 deletions src/main/resources/templates/main-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h3>Draw your number here</h3>

<button type="reset"
style="margin-top:10px; margin-left:55px; font-size: 18px"
onClick="resetCanvas()">Clear</button>
onClick="clearCanvasAndAnswer()">Clear</button>

<div id="myAnswerHolder"></div>

Expand Down Expand Up @@ -138,9 +138,11 @@ <h3>Draw your number here</h3>
canvas.addEventListener('mousemove', drawmove, false);
canvas.addEventListener('mouseup', drawend, false);

function resetCanvas(){
function clearCanvasAndAnswer(){
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillRect(0, 0, 280, 280);
const myNode = document.getElementById("myAnswerHolder");
myNode.innerHTML = '';
}
</script>

Expand Down

0 comments on commit 8e41601

Please sign in to comment.