mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 16:32:40 +00:00
Change for line consistency when moving to page 1
This commit is contained in:
@@ -202,15 +202,14 @@ const Editor = createClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(currentPage > 1){
|
const textSplit = this.props.renderer == 'V3' ? '\n\\page\n' : '\\page';
|
||||||
const textString = this.props.brew.text.split('\\page').slice(0, currentPage-1).join('\\page');
|
const textString = this.props.brew.text.split(textSplit).slice(0, currentPage-1).join(textSplit);
|
||||||
const textPosition = textString.length;
|
const textPosition = textString.length;
|
||||||
const lineCount = textString.slice(0, textPosition).split('\n').length;
|
const lineCount = textString.match('\n') ? textString.slice(0, textPosition).split('\n').length : 0;
|
||||||
|
|
||||||
targetLine = lineCount;
|
targetLine = lineCount;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Math.floor(target.scrollTop / target.scrollHeight * prevState.pages.length);
|
|
||||||
this.refs.codeEditor.setCursorPosition(targetLine, 0);
|
this.refs.codeEditor.setCursorPosition(targetLine, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user