Merge pull request #377 from yueyuzhao/issue/334-fix-ios-callout

disable drag & drop on images
This commit is contained in:
chrisgarrity 2021-05-25 11:36:21 -04:00 committed by GitHub
commit f517e0488a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -107,6 +107,9 @@ export default class Sprite {
setCostume (dataurl, fcn) {
var img = document.createElement('img');
img.ondragstart = function () {
return false;
}
img.src = dataurl;
this.img = img;
// Make a copy that is not affected by zoom transformation

View file

@ -198,6 +198,9 @@ export default class Library {
img.style.top = (7 * scaleMultiplier) + 'px';
img.style.position = 'relative';
img.style.height = (data.height * scale) + 'px';
img.ondragstart = function () {
return false;
}
if (data.altmd5) {
IO.getAsset(data.altmd5, drawMe);
}

View file

@ -300,6 +300,9 @@ export default class Home {
if (md5) {
IO.getAsset(md5, drawMe);
}
img.ondragstart = function () {
return false;
}
function drawMe (url) {
img.src = url;
}