add ability to selecively disable ops
This commit is contained in:
parent
77ff79feb5
commit
e19c27170a
4 changed files with 19 additions and 2 deletions
|
|
@ -2239,7 +2239,7 @@
|
|||
// block standard browser context menu
|
||||
DOC.oncontextmenu = (event) => {
|
||||
let et = event.target;
|
||||
if (et.tagName === 'CANVAS' || et.id === 'context-menu') {
|
||||
if (et.tagName === 'CANVAS' || et.id === 'context-menu' || et.classList.contains('draggable')) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
let opSum = 0;
|
||||
let opTot = opList.map(op => op.weight()).reduce((a,v) => a + v);
|
||||
|
||||
for (let op of proc.ops) {
|
||||
for (let op of proc.ops.filter(op => !op.disabled)) {
|
||||
let opfn = OPS[op.type];
|
||||
if (opfn) {
|
||||
let opin = new opfn(state, op);
|
||||
|
|
|
|||
Loading…
Reference in a new issue