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:
@@ -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 />
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
position : relative;
|
||||
}
|
||||
.brewRenderer{
|
||||
overflow-y : scroll;
|
||||
will-change : transform;
|
||||
overflow-y : scroll;
|
||||
.pages{
|
||||
margin : 30px 0px;
|
||||
&>.phb{
|
||||
|
||||
Reference in New Issue
Block a user