1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 01:41:39 +00:00

fix-resizer (#3016)

This commit is contained in:
Michael An
2019-02-28 16:39:43 +08:00
committed by Daniel Pan
parent 97317b5df8
commit 8818fc1c8e
2 changed files with 6 additions and 5 deletions

View File

@@ -103,10 +103,10 @@ class DirColumnView extends React.Component {
navRate: 0.12, navRate: 0.12,
}); });
} }
else if (rate > 0.9) { else if (rate > 0.4) {
this.setState({ this.setState({
inResizing: false, inResizing: false,
navRate: 0.88, navRate: 0.38,
}); });
} }
else { else {
@@ -140,12 +140,13 @@ class DirColumnView extends React.Component {
this.setState({ this.setState({
navRate: rate, navRate: rate,
}); });
} }
} }
render() { render() {
const onResizeMove = this.state.inResizing ? this.onResizeMouseMove : null; const onResizeMove = this.state.inResizing ? this.onResizeMouseMove : null;
const select = this.state.inResizing ? 'none' : ''; const select = this.state.inResizing ? 'none' : '';
const mainFlex = '1 0 ' + (1 - this.state.navRate) * 100 + '%';
return ( return (
<div className="cur-view-content view-mode-container" onMouseMove={onResizeMove} onMouseUp={this.onResizeMouseUp} ref="viewModeContainer"> <div className="cur-view-content view-mode-container" onMouseMove={onResizeMove} onMouseUp={this.onResizeMouseUp} ref="viewModeContainer">
<DirColumnNav <DirColumnNav
@@ -166,7 +167,7 @@ class DirColumnView extends React.Component {
inResizing={this.state.inResizing} inResizing={this.state.inResizing}
/> />
<div className="dir-content-resize" onMouseDown={this.onResizeMouseDown}></div> <div className="dir-content-resize" onMouseDown={this.onResizeMouseDown}></div>
<div className="dir-content-main" style={{userSelect: select}}> <div className="dir-content-main" style={{userSelect: select, flex: mainFlex}}>
{this.props.isViewFile ? ( {this.props.isViewFile ? (
<DirColumnFile <DirColumnFile
path={this.props.path} path={this.props.path}

View File

@@ -21,7 +21,7 @@
} }
.dir-content-main { .dir-content-main {
flex: 1 0 75% !important; flex: 1 0 75%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-right: -1rem; margin-right: -1rem;