disable drag & drop on images

This commit is contained in:
Yueyu 2020-11-09 21:25:27 +08:00
parent a5c182d05c
commit db3821488d
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;
}