1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

In mobile mode the buttons are displayed in click on the page

This commit is contained in:
Vincent LAURENT 2022-05-18 01:42:41 +02:00
parent eb170fcd63
commit cfcd34829e

View File

@ -81,7 +81,18 @@ var loadPDF = async function(pdfBlob, filename, pdfIndex) {
document.getElementById('container-pages').insertAdjacentHTML('beforeend', pageHTML); document.getElementById('container-pages').insertAdjacentHTML('beforeend', pageHTML);
let canvasContainer = document.getElementById('canvas-container-' + pageIndex); let canvasContainer = document.getElementById('canvas-container-' + pageIndex);
canvasContainer.addEventListener('click', function(e) {
if(!is_mobile()) {
return;
}
let checkbox = this.querySelector('input[type=checkbox].input-hover');
checkbox.checked = !checkbox.checked;
updatePageState(this);
});
canvasContainer.addEventListener('mouseenter', function(e) { canvasContainer.addEventListener('mouseenter', function(e) {
if(is_mobile()) {
return false;
}
this.querySelector('input[type=checkbox].input-hover').checked = true; this.querySelector('input[type=checkbox].input-hover').checked = true;
updatePageState(this); updatePageState(this);
}); });