0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 21:42:45 +00:00

Moved imgs and fonts into the new style folder

This commit is contained in:
Scott Tolksdorf
2017-02-23 09:58:10 -05:00
parent a33b1d845d
commit fd567352a4
30 changed files with 132 additions and 102 deletions

View File

@@ -35,7 +35,7 @@ const BrewEditor = React.createClass({
componentDidMount: function() {
this.updateEditorSize();
//this.highlightPageLines();
this.highlightPageLines();
window.addEventListener("resize", this.updateEditorSize);
},
componentWillUnmount: function() {
@@ -89,11 +89,15 @@ const BrewEditor = React.createClass({
if(!this.refs.codeEditor) return;
const codeMirror = this.refs.codeEditor.codeMirror;
const lineNumbers = _.reduce(this.props.value.split('\n'), (r, line, lineNumber)=>{
const lineNumbers = _.reduce(this.props.brew.text.split('\n'), (r, line, lineNumber)=>{
if(line.indexOf('\\page') !== -1){
codeMirror.addLineClass(lineNumber, 'background', 'pageLine');
r.push(lineNumber);
}
if(_.startsWith(line, '{{') || _.startsWith(line, '}}')){
codeMirror.addLineClass(lineNumber, 'text', 'block');
}
return r;
}, []);
return lineNumbers
@@ -134,6 +138,7 @@ const BrewEditor = React.createClass({
},
render : function(){
this.highlightPageLines();
return <div className='brewEditor' ref='main'>
{/*
<SnippetBar