0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 09:12:45 +00:00

Simplify scroll event for source editor using lodash Throttle

This commit is contained in:
Trevor Buckner
2024-09-10 00:43:44 -04:00
parent b5155ed256
commit ec74b994d7
2 changed files with 5 additions and 10 deletions

View File

@@ -154,8 +154,9 @@ const Editor = createClass({
scrollingJump = false;
},
handleSourceScroll : function(e) {
handleSourceScroll : function() {
if(!this.props.liveScroll) return;
console.log("handleSourceScroll")
scrollingJump = true;
this.brewJump();
scrollingJump = false;
@@ -356,6 +357,7 @@ const Editor = createClass({
},
brewJump : function(targetPage=this.getCurrentPage()){
console.log('jumpbrew')
if(lockBrewJump) return;
if(!window) return;
lockSourceJump = true;