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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user