mirror of
https://github.com/heyman/heynote.git
synced 2025-01-11 00:18:29 +01:00
Fix broken Mod-L shortcut
This commit is contained in:
parent
b35e4840a4
commit
1abefce1ec
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { HeynoteEditor } from '../editor/editor.js'
|
import { HeynoteEditor, LANGUAGE_SELECTOR_EVENT } from '../editor/editor.js'
|
||||||
import { syntaxTree } from "@codemirror/language"
|
import { syntaxTree } from "@codemirror/language"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -25,7 +25,7 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$refs.editor.addEventListener("openLanguageSelector", (e) => {
|
this.$refs.editor.addEventListener(LANGUAGE_SELECTOR_EVENT, (e) => {
|
||||||
this.$emit("openLanguageSelector")
|
this.$emit("openLanguageSelector")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@ import { heynoteKeymap } from "./keymap.js"
|
|||||||
import { languageDetection } from "./language-detection/autodetect.js"
|
import { languageDetection } from "./language-detection/autodetect.js"
|
||||||
import { autoSaveContent } from "./save.js"
|
import { autoSaveContent } from "./save.js"
|
||||||
|
|
||||||
|
export const LANGUAGE_SELECTOR_EVENT = "openLanguageSelector"
|
||||||
|
|
||||||
|
|
||||||
export class HeynoteEditor {
|
export class HeynoteEditor {
|
||||||
constructor({element, content, focus=true, theme="light", saveFunction=null}) {
|
constructor({element, content, focus=true, theme="light", saveFunction=null}) {
|
||||||
@ -74,7 +76,7 @@ export class HeynoteEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
openLanguageSelector() {
|
openLanguageSelector() {
|
||||||
this.element.dispatchEvent(new Event("open-language-selector"))
|
this.element.dispatchEvent(new Event(LANGUAGE_SELECTOR_EVENT))
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentLanguage(lang, auto=false) {
|
setCurrentLanguage(lang, auto=false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user