mirror of https://github.com/shadowfacts/type.git
Make the editor fill the viewport
This commit is contained in:
parent
0ade2dcfbc
commit
8ad95c907a
|
@ -8,6 +8,8 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<textarea id="editor"></textarea>
|
||||
|
||||
<script src="codemirror/codemirror.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
||||
<script src="main.js"></script>
|
||||
|
|
8
main.css
8
main.css
|
@ -5,4 +5,10 @@
|
|||
|
||||
.incomplete {
|
||||
color: gray !important;
|
||||
}
|
||||
}
|
||||
|
||||
#editor {
|
||||
display: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
7
main.js
7
main.js
|
@ -29,8 +29,9 @@ $.get({
|
|||
|
||||
// setup
|
||||
function setup(data, mode) {
|
||||
editor = new CodeMirror(document.body, {
|
||||
value: data,
|
||||
let el = document.getElementById("editor");
|
||||
el.value = data;
|
||||
editor = CodeMirror.fromTextArea(el, {
|
||||
mode: mode,
|
||||
readOnly: true,
|
||||
autofocus: true,
|
||||
|
@ -42,6 +43,8 @@ function setup(data, mode) {
|
|||
}
|
||||
});
|
||||
|
||||
editor.setSize("100%", "100%");
|
||||
|
||||
incompleteMark = editor.doc.markText({ line: 0, ch: 0 }, getEndPos(), {
|
||||
className: "incomplete"
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue