0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 16:02:38 +00:00

Move will-change to stylesheet

This makes `will-change: transform` permanent in the brewRenderer stylesheet rather than trying to load and unload it programatically.
This commit is contained in:
Trevor Buckner
2018-05-13 09:23:03 -04:00
committed by Rae2che5
parent 0cc87a4f0f
commit eb08172fb1
2 changed files with 3 additions and 18 deletions

View File

@@ -25,7 +25,6 @@ const BrewRenderer = createClass({
return {
viewablePageNumber : 0,
height : 0,
willChange : 'auto',
isMounted : false,
usePPR : true,
@@ -127,20 +126,6 @@ const BrewRenderer = createClass({
return this.lastRender;
},
/**
* Optimize for smooth scrolling when mouse enters the rendering panel
**/
prepareScroll : function(){
this.setState({ willChange: 'transform' });
},
/**
* Unload smooth scrolling optimizations when mouse leaves rendering panel
**/
unprepareScroll : function(){
this.setState({ willChange: 'auto' });
},
render : function(){
return (
<React.Fragment>
@@ -149,8 +134,7 @@ const BrewRenderer = createClass({
onMouseOver={this.prepareScroll}
onMouseOut={this.unprepareScroll}
ref='main'
style={{ height : this.state.height,
willChange : this.state.willChange }}>
style={{ height : this.state.height }}>
<ErrorBar errors={this.props.errors} />
<RenderWarnings />

View File

@@ -4,7 +4,8 @@
position : relative;
}
.brewRenderer{
overflow-y : scroll;
will-change : transform;
overflow-y : scroll;
.pages{
margin : 30px 0px;
&>.phb{