Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 1cdfcf4

Browse files
committed
Update for new version of Mint.
1 parent 78931ba commit 1cdfcf4

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

source/CodeMirror.mint

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ component CodeMirror {
1313
]
1414

1515
/* Handler for the change event. */
16-
property onChange : Function(String, a) = ((value : String) : Void => { void })
16+
property onChange : Function(String, a) = ((value : String) : Void { void })
1717

1818
/* The content to display until the editor is loaded. */
1919
property loadingContent : Html = <></>
@@ -39,24 +39,14 @@ component CodeMirror {
3939
}
4040
}
4141

42-
/* Saves the reference to the textarea. */
43-
fun saveReference (element : Dom.Element) : Void {
44-
`
45-
(() => {
46-
if (this.element) { return }
47-
this.element = element
48-
})()
49-
`
50-
}
51-
5242
/* Initializes the editor for the given dom element. */
5343
fun initializeEditor : Void {
5444
`
5545
(() => {
56-
if (!this.element) { return }
46+
if (!this._element) { return }
5747
if (this.editor) { return }
5848

59-
this.editor = CodeMirror.fromTextArea(this.element, {
49+
this.editor = CodeMirror.fromTextArea(this._element, {
6050
lineNumbers: this.lineNumbers,
6151
theme: this.theme,
6252
mode: this.mode,
@@ -105,7 +95,7 @@ component CodeMirror {
10595
/* Renders the component. */
10696
fun render : Array(Html) {
10797
[
108-
<textarea::editor ref={saveReference}/>,
98+
<textarea::editor as element/>,
10999
if (`this.editor`) {
110100
<></>
111101
} else {

0 commit comments

Comments
 (0)