add ability to selecively disable ops

This commit is contained in:
Stewart Allen 2021-05-03 14:48:03 -04:00
commit e19c27170a
4 changed files with 19 additions and 2 deletions

View file

@ -290,6 +290,9 @@
func.opDel(rec);
};
let el = $(id);
if (rec.disabled) {
el.classList.add("disabled");
}
bounds.push(el);
let timer = null;
let inside = true;
@ -331,6 +334,17 @@
if (!clist.contains("draggable")) {
return;
}
if (ev.ctrlKey || ev.metaKey) {
rec.disabled = !rec.disabled;
ev.preventDefault();
ev.stopPropagation();
if (rec.disabled) {
clist.add("disabled");
} else {
clist.remove("disabled");
}
return true;
}
clist.add("drag");
ev.stopPropagation();
ev.preventDefault();