mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Suppression d'éléments avec la touche "Suppr"
This commit is contained in:
parent
5518669d24
commit
7bd1f99d9c
14
js/app.js
14
js/app.js
@ -62,6 +62,20 @@ loadingTask.promise.then(function(pdf) {
|
||||
})
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if(event.target.tagName != "BODY") {
|
||||
return;
|
||||
}
|
||||
if(event.key == 'Delete') {
|
||||
canvasEditions.forEach(function(canvasEdition, index) {
|
||||
canvasEdition.getActiveObjects().forEach(function(activeObject) {
|
||||
canvasEdition.remove(activeObject);
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
for(var pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++ ) {
|
||||
pdf.getPage(pageNumber).then(function(page) {
|
||||
var scale = 1.5;
|
||||
|
Loading…
Reference in New Issue
Block a user