pixelate: respond to touch events

This commit is contained in:
zotlabs 2019-07-30 19:15:43 -07:00
parent 3bc243ea46
commit 52502148ca
3 changed files with 20 additions and 3 deletions

View file

@ -1,5 +1,5 @@
ZAP
===
Zap is an open source decentralised social network with more privacy and less drama.
Zap is an open source decentralised social network with more privacy and less drama.

View file

@ -90,6 +90,14 @@
ctx.drawImage(element, 0, 0, imgWidth, imgHeight);
});
canv.addEventListener('touchstart', function () {
if (revealed) {
return;
}
ctx.drawImage(element, 0, 0, imgWidth, imgHeight);
});
canv.addEventListener('mouseleave', function () {
if (revealed) {
return;
@ -98,7 +106,16 @@
ctx.drawImage(element, 0, 0, width, height);
ctx.drawImage(canv, 0, 0, width, height, 0, 0, canv.width, canv.height);
});
}
canv.addEventListener('touchend', function () {
if (revealed) {
return;
}
ctx.drawImage(element, 0, 0, width, height);
ctx.drawImage(canv, 0, 0, width, height, 0, 0, canv.width, canv.height);
});
}
};
if (typeof $ === 'function') {

View file

@ -13,7 +13,7 @@ head_add_js('/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js');
head_add_js('/library/bootbox/bootbox.min.js');
head_add_js('/library/bootstrap-tagsinput/bootstrap-tagsinput.js');
head_add_js('/library/datetimepicker/jquery.datetimepicker.js');
head_add_js('/library/pixelate.js/pixelate.min.js');
head_add_js('/library/pixelate.js/dist/pixelate.js');
head_add_js('/library/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js');