Skip to content

Commit e136c7d

Browse files
author
Zaydek Michels-Gualtieri
committed
Better comments
1 parent 69397aa commit e136c7d

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/Editor/Editor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const Editor = ({ html }) => {
6565

6666
// Returns a handler when read-only mode is disabled.
6767
const readWriteHandler = handler => {
68-
if (state.isReadOnlyModeEnabled) {
68+
if (state.readOnlyModeEnabled) {
6969
return undefined
7070
}
7171
return handler
@@ -233,8 +233,8 @@ const Editor = ({ html }) => {
233233
// e.preventDefault()
234234
// })}
235235

236-
contentEditable={!state.isReadOnlyModeEnabled}
237-
suppressContentEditableWarning={!state.isReadOnlyModeEnabled}
236+
contentEditable={!state.readOnlyModeEnabled}
237+
suppressContentEditableWarning={!state.readOnlyModeEnabled}
238238
data-root
239239
/>
240240

src/Editor/model/Editor/Editor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import Range from "./Range"
22
import { immerable } from "immer"
33

4+
// Describes an editor.
45
class Editor {
56
[immerable] = true
67

78
// NOTE: DOMContentLoaded disables read-only mode.
8-
isReadOnlyModeEnabled = true
9-
isActiveElement = false
9+
readOnlyModeEnabled = true
10+
focused = false
1011
elements = []
1112
range = new Range()
1213
shouldRerender = 0
@@ -42,6 +43,7 @@ class Editor {
4243
// ..
4344
}
4445

46+
// Resolves to serialized HTML.
4547
toSerializedHTML() {
4648
// ..
4749
}

src/Editor/model/Editor/Element.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import hash from "lib/hash"
22
import { immerable } from "immer"
33

4+
// Describes an element. Unlike multiline elements, elements
5+
// cannot render further sub-elements.
46
class Element {
57
[immerable] = true
68

src/Editor/model/Editor/MultilineElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import hash from "lib/hash"
22
import { immerable } from "immer"
33

4-
// Describes an element that renders one or more sub-
5-
// elements, such as <pre>, <ul>, and <ol>.
4+
// Describes an element. Unlike elements, multiline elements
5+
// can render further sub-elements.
66
class MultilineElement {
77
[immerable] = true
88

0 commit comments

Comments
 (0)