Disable save hotkey when it is not appropriate
This commit is contained in:
parent
534dffdfe3
commit
ecf4c1e98e
1 changed files with 2 additions and 2 deletions
|
@ -187,8 +187,8 @@ function openEditor() {
|
||||||
document.addEventListener("keypress", function (ev) {
|
document.addEventListener("keypress", function (ev) {
|
||||||
const accel = ev.ctrlKey || ev.metaKey; // Imprecise, but works cross platform
|
const accel = ev.ctrlKey || ev.metaKey; // Imprecise, but works cross platform
|
||||||
if (ev.key === "Enter" && accel) {
|
if (ev.key === "Enter" && accel) {
|
||||||
//TODO Disable when in the process of saving
|
const isEditing = container.classList.contains('edit');
|
||||||
//TODO Disable when not editing
|
if (!isEditing) return;
|
||||||
|
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
Loading…
Reference in a new issue