نسخ من khaledmahfouz5/Maqtaa
Wrap editor code in DOMContentLoaded
هذا الالتزام موجود في:
7
public/editor.js
مباع
7
public/editor.js
مباع
@@ -2,6 +2,7 @@ import {EditorView, gutter, keymap, lineNumbers} from "@codemirror/view"
|
||||
import {Compartment, EditorState, Facet, SelectionRange} from "@codemirror/state"
|
||||
import {indentLess} from "@codemirror/commands";
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
EditorView.theme({}, {dark: true})
|
||||
|
||||
let editorsjs = []
|
||||
@@ -103,7 +104,10 @@ function changeBySelectedLine(state, f) {
|
||||
line = state.doc.lineAt(line.number + 1)
|
||||
}
|
||||
let changeSet = state.changes(changes)
|
||||
return {changes, range: new SelectionRange(changeSet.mapPos(range.anchor, 1), changeSet.mapPos(range.head, 1))}
|
||||
return {
|
||||
changes,
|
||||
range: new SelectionRange(changeSet.mapPos(range.anchor, 1), changeSet.mapPos(range.head, 1))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -155,3 +159,4 @@ document.querySelector('form#create').onsubmit = () => {
|
||||
document.onsubmit = () => {
|
||||
window.onbeforeunload = null;
|
||||
}
|
||||
})
|
||||
المرجع في مشكلة جديدة
حظر مستخدم