Skip to content

Commit e14c840

Browse files
authored
Update README.md
1 parent 4b220f8 commit e14c840

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ In order to make CodeMirror work correctly, do not forget to start your HTML pag
1414

1515
##### Initialize
1616

17-
`codemirrorOptions` can be `null` or contain original CodeMirror settings
17+
`codemirrorOptions` can be `null` (ignored) or contain original CodeMirror settings
1818

19-
`jqueryCodemirroOptions` can be `null` (ignored)
19+
`jqueryCodemirrorOptions` can be `null` (ignored)
2020

2121
```
2222
$(...).codemirrorInit(codemirrorOptions, jqueryCodemirrorOptions);
@@ -30,7 +30,7 @@ lineNumbers: true,
3030
lineWrapping: true
3131
```
3232

33-
`NB!` Do not forget to add required mode `mode/xml/xml.js`
33+
`NB!` Do not forget to add required CodeMirror mode `mode/xml/xml.js`
3434

3535
`jqueryCodemirrorDefaults` are:
3636

@@ -40,26 +40,26 @@ height: "auto"; (Set in CSS)
4040

4141
Height options are `auto` and `inherit`
4242

43-
When `auto`, CodeMirror container is auto resized. (Container's CSS parameter `height` value should be `auto`! May have `min-height`, should not ave `max-height`)
43+
When `auto`, CodeMirror container is auto resized. (Container's CSS parameter `height` value should be `auto`! May have `min-height`, should not have `max-height`)
4444

4545
When `inherit`, CodeMirror container is not resized, scroll-bar appears. (Container's CSS `height` value should not be `auto`! )
4646

4747

48-
You can set CodeMirror configs in DOM element attribute `codemirror-config` or `codemirror`. Latest is preferred.
48+
You can set CodeMirror configs in DOM element attribute `codemirror-config` or `codemirror` in JSON format. Latest is preferred.
4949

5050
```
5151
<div codemirror='{"autofocus": true, "value": "Hello world"}'></div>
5252
```
5353

54-
You can set plugin configs in DOM element attribute `jquery-codemirror-config` or `jquery-codemirror`. Latest is preferred.
54+
You can set plugin configs in DOM element attribute `jquery-codemirror-config` or `jquery-codemirror` in JSON format. Latest is preferred.
5555

5656
```
5757
<div jquery-codemirror='{"height": "inherit"}'></div>
5858
```
5959

6060
##### CodeMirror methods
6161

62-
CodeMirror object is initialized and saved for each element via `$.data(element, 'codemirror)`
62+
CodeMirror object is initialized and saved for each element via `$.data(element, 'codemirror')`
6363

6464
You can access it and use as specified in CodeMirror manual
6565

@@ -72,3 +72,5 @@ Plugin itself adds `setValue(string), getValue(), setOption(option, value), setO
7272
```
7373
$(...).codemirror().getValue()
7474
```
75+
76+
`NB!` Plugin's options (height) cannot be set outside initialization (yet).

0 commit comments

Comments
 (0)