Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case code("J"):
if (e.currentTarget.nextSibling)
FocusManager.focusFirst(e.currentTarget.nextSibling);
break;
case KeyCode.left:
case code("H"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.previousSibling) FocusManager.focusFirst(list.previousSibling);
break;
case KeyCode.right:
case code("L"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.nextSibling) FocusManager.focusFirst(list.nextSibling);
break;
}
},
let u1 = registerKeyboardShortcut({ keyCode: 27 }, (e) => {
if (document.activeElement.classList.contains("cxb-task"))
return;
e.preventDefault();
e.stopPropagation();
let els = document.getElementsByClassName("cxb-task");
if (els && els.length > 0) FocusManager.focusFirst(els[0]);
});
}, () => {
if (elementReceivingFocus)
FocusManager.focusFirst(elementReceivingFocus);
});
break;
case KeyCode.left:
case code("H"):
case code("B"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.previousSibling && list.previousSibling.previousSibling)
FocusManager.focusFirst(list.previousSibling.previousSibling);
break;
case KeyCode.right:
case code("W"):
case code("L"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.nextSibling && list.nextSibling.nextSibling)
FocusManager.focusFirst(list.nextSibling.nextSibling);
break;
}
},
let u2 = registerKeyboardShortcut({ keyCode: 191 }, (e) => {
if (e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA")
return;
e.preventDefault();
e.stopPropagation();
if (!e.shiftKey) {
let searchEl = document.getElementById("search");
FocusManager.focusFirst(searchEl);
}
else {
History.pushState({}, null, "~/help");
}
});
switch (e.keyCode) {
case code("K"):
if (e.currentTarget.previousSibling)
FocusManager.focusFirst(e.currentTarget.previousSibling);
break;
case code("J"):
if (e.currentTarget.nextSibling)
FocusManager.focusFirst(e.currentTarget.nextSibling);
break;
case KeyCode.left:
case code("H"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.previousSibling) FocusManager.focusFirst(list.previousSibling);
break;
case KeyCode.right:
case code("L"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.nextSibling) FocusManager.focusFirst(list.nextSibling);
break;
}
},
onTaskListKeyDown(e, instance) {
let code = c => c.charCodeAt(0),
list;
switch (e.keyCode) {
case code("K"):
if (e.currentTarget.previousSibling && e.currentTarget.previousSibling.previousSibling)
FocusManager.focusFirst(e.currentTarget.previousSibling.previousSibling);
break;
case code("J"):
if (e.currentTarget.nextSibling && e.currentTarget.nextSibling.nextSibling)
FocusManager.focusFirst(e.currentTarget.nextSibling.nextSibling);
break;
case KeyCode.left:
case code("H"):
case code("B"):
list = closest(e.target, el => el.classList.contains("cxb-tasklist"));
if (list.previousSibling && list.previousSibling.previousSibling)
FocusManager.focusFirst(list.previousSibling.previousSibling);
break;
case KeyCode.right: