Skip to content

Commit

Permalink
Stockage des élément de signature dans le localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
wincelau committed Sep 25, 2021
1 parent 9ef0c00 commit 9ba7fee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ loadingTask.promise.then(function(pdf) {
var activeCanvasPointer = null;
var canvasEditions = [];
var svgCollections = [];

if(localStorage.getItem('svgCollections')) {
svgCollections = JSON.parse(localStorage.getItem('svgCollections'));
console.log(svgCollections);
}

opentype.load('/vendor/fonts/Caveat-Regular.ttf', function(err, font) {
fontCaveat = font;
Expand Down Expand Up @@ -69,8 +74,8 @@ loadingTask.promise.then(function(pdf) {
svgCollections.push(document.getElementById('img-upload').src);
}
displaysSVG();

document.querySelector('#svg_list label:last-child').click();
localStorage.setItem('svgCollections', JSON.stringify(svgCollections));
});

function dataURLtoBlob(dataurl) {
Expand Down

0 comments on commit 9ba7fee

Please sign in to comment.