diff options
Diffstat (limited to 'src/editor.mjs')
-rw-r--r-- | src/editor.mjs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index 92513a3..539a770 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
@@ -151,10 +151,11 @@ const debounceForMap = (() => { | |||
151 | let timer = null; | 151 | let timer = null; |
152 | 152 | ||
153 | return function(...args) { | 153 | return function(...args) { |
154 | clearTimeout(timer); | ||
155 | timer = setTimeout(() => { | ||
156 | dumbymap = generateMaps.apply(this, args) | 154 | dumbymap = generateMaps.apply(this, args) |
157 | }, 1000); | 155 | // clearTimeout(timer); |
156 | // timer = setTimeout(() => { | ||
157 | // dumbymap = generateMaps.apply(this, args) | ||
158 | // }, 10); | ||
158 | } | 159 | } |
159 | })() | 160 | })() |
160 | 161 | ||
@@ -542,9 +543,9 @@ document.onkeydown = (e) => { | |||
542 | e.preventDefault() | 543 | e.preventDefault() |
543 | dumbymap.utils.focusNextMap(e.shiftKey) | 544 | dumbymap.utils.focusNextMap(e.shiftKey) |
544 | } | 545 | } |
545 | if (e.key === 'x') { | 546 | if (e.key === 'x' || e.key === 'X') { |
546 | e.preventDefault() | 547 | e.preventDefault() |
547 | dumbymap.utils.switchToNextLayout() | 548 | dumbymap.utils.switchToNextLayout(e.shiftKey) |
548 | } | 549 | } |
549 | if (e.key === 'n') { | 550 | if (e.key === 'n') { |
550 | e.preventDefault() | 551 | e.preventDefault() |
@@ -563,6 +564,7 @@ document.onkeydown = (e) => { | |||
563 | 564 | ||
564 | // }}} | 565 | // }}} |
565 | // }}} | 566 | // }}} |
567 | // Layout Switch {{{ | ||
566 | const layoutObserver = new MutationObserver(() => { | 568 | const layoutObserver = new MutationObserver(() => { |
567 | const layout = HtmlContainer.getAttribute('data-layout') | 569 | const layout = HtmlContainer.getAttribute('data-layout') |
568 | if (layout !== 'normal') { | 570 | if (layout !== 'normal') { |
@@ -575,5 +577,6 @@ layoutObserver.observe(HtmlContainer, { | |||
575 | attributeFilter: ["data-layout"], | 577 | attributeFilter: ["data-layout"], |
576 | attributeOldValue: true | 578 | attributeOldValue: true |
577 | }); | 579 | }); |
580 | // }}} | ||
578 | 581 | ||
579 | // vim: sw=2 ts=2 foldmethod=marker foldmarker={{{,}}} | 582 | // vim: sw=2 ts=2 foldmethod=marker foldmarker={{{,}}} |