Merge pull request #66 from MathuraMG/temp

populate current line number differently
This commit is contained in:
Cassie Tarakajian 2016-08-25 12:45:22 -04:00 committed by GitHub
commit fc0049e2d7
2 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,8 @@ class Editor extends React.Component {
this.props.updateFileContent(this.props.file.name, this._cm.getValue());
}));
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.props.updateFileContent('sketch.js', this._cm.getValue());

View File

@ -27,7 +27,7 @@ class EditorAccessibility extends React.Component {
{messages}
</ul>
<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>
</div>
);