Table of Content
List of drawings
What we do here is add a button that save the current drawing to an array. And have a list of current stored drawings in Img tags.
The button HTML
1<a id='save-drawing' data-role='button'>Save Drawing</a>
The images container
1<div id="drawings-list"></div>
The button click handler
The logic:
1app.drawings = [];
Adding 2 methods to the drawing pad. clear
to clear the canvas data and data
to return the canvas into base64 URL encoded.
The view
By the way, Empty the whole list is slow. Try improve the code to just push the new image to the list.
What’s next? We’re going to take a look at “Introducing WebSQL”.