0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 18:52:38 +00:00

Set a default userSetDividerPos

This commit is contained in:
G.Ambatte
2022-05-29 16:26:30 +12:00
parent eff2ec20b2
commit bb1fba27c2

View File

@@ -34,7 +34,8 @@ const SplitPane = createClass({
}); });
} else { } else {
this.setState({ this.setState({
currentDividerPos : window.innerWidth / 2 currentDividerPos : window.innerWidth / 2,
userSetDividerPos : window.innerWidth / 2
}); });
} }
window.addEventListener('resize', this.handleWindowResize); window.addEventListener('resize', this.handleWindowResize);
@@ -47,7 +48,7 @@ const SplitPane = createClass({
handleWindowResize : function() { handleWindowResize : function() {
// Allow divider to increase in size to last user-set position // Allow divider to increase in size to last user-set position
// Limit current position to between 10% and 90% of visible space // Limit current position to between 10% and 90% of visible space
const newLoc = this.limitPosition(this.state.userSetDividerPos || this.state.currentDividerPos, 0.1*(window.innerWidth-13), 0.9*(window.innerWidth-13)); const newLoc = this.limitPosition(this.state.userSetDividerPos, 0.1*(window.innerWidth-13), 0.9*(window.innerWidth-13));
this.setState({ this.setState({
currentDividerPos : newLoc, currentDividerPos : newLoc,