0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 09:52:41 +00:00

Fixed saving authors and systems to brews

This commit is contained in:
Scott Tolksdorf
2017-01-19 12:06:14 -05:00
parent c417c1aa0c
commit 70346ffce7
4 changed files with 27 additions and 5 deletions

View File

@@ -73,6 +73,22 @@ const Editor = React.createClass({
return r;
}, 1);
},
highlightPageLines : function(){
if(!this.refs.codeEditor) return;
const codeMirror = this.refs.codeEditor.codeMirror;
const lineNumbers = _.reduce(this.props.value.split('\n'), (r, line, lineNumber)=>{
if(line.indexOf('\\page') !== -1){
codeMirror.addLineClass(lineNumber, 'background', 'pageLine');
r.push(lineNumber);
}
return r;
}, []);
return lineNumbers
},
brewJump : function(){
const currentPage = this.getCurrentPage();
window.location.hash = 'p' + currentPage;