mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 08:12:39 +00:00
Initial pass: reset pane width on browser resize
This commit is contained in:
@@ -10,7 +10,6 @@ const SplitPane = createClass({
|
|||||||
return {
|
return {
|
||||||
storageKey : 'naturalcrit-pane-split',
|
storageKey : 'naturalcrit-pane-split',
|
||||||
onDragFinish : function(){} //fires when dragging
|
onDragFinish : function(){} //fires when dragging
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getInitialState : function() {
|
getInitialState : function() {
|
||||||
@@ -26,6 +25,17 @@ const SplitPane = createClass({
|
|||||||
size : paneSize
|
size : paneSize
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
window.addEventListener('resize', this.resetSize);
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount : function() {
|
||||||
|
window.removeEventListener('resize', this.resetSize);
|
||||||
|
},
|
||||||
|
|
||||||
|
resetSize : function() {
|
||||||
|
this.setState({
|
||||||
|
size : window.innerWidth / 2
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleUp : function(){
|
handleUp : function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user