add word line
This commit is contained in:
parent
76492cec6f
commit
db85dcc04b
2 changed files with 3 additions and 2 deletions
|
@ -54,7 +54,8 @@ class Editor extends React.Component {
|
||||||
this.props.updateFileContent(this.props.file.name, this._cm.getValue());
|
this.props.updateFileContent(this.props.file.name, this._cm.getValue());
|
||||||
}));
|
}));
|
||||||
this._cm.on('keyup', () => {
|
this._cm.on('keyup', () => {
|
||||||
this.props.updateLineNumber(parseInt((this._cm.getCursor().line) + 1, 10));
|
const temp = `line ${parseInt((this._cm.getCursor().line) + 1, 10)}`;
|
||||||
|
document.getElementById('current-line').innerHTML = temp;
|
||||||
});
|
});
|
||||||
// this._cm.on('change', () => { // eslint-disable-line
|
// this._cm.on('change', () => { // eslint-disable-line
|
||||||
// // this.props.updateFileContent('sketch.js', this._cm.getValue());
|
// // this.props.updateFileContent('sketch.js', this._cm.getValue());
|
||||||
|
|
|
@ -27,7 +27,7 @@ class EditorAccessibility extends React.Component {
|
||||||
{messages}
|
{messages}
|
||||||
</ul>
|
</ul>
|
||||||
<p> Current line
|
<p> Current line
|
||||||
<span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> {this.props.lineNumber} </span>
|
<span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> </span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue