1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 19:08:21 +00:00

fix: resize (#6319)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-07-09 17:00:12 +08:00
committed by GitHub
parent 1f0ac4fbc8
commit 1ae64295c9
7 changed files with 16 additions and 7 deletions

View File

@@ -4,8 +4,10 @@ import DirColumnNav from './dir-column-nav';
import DirColumnFile from './dir-column-file';
import DirListView from './dir-list-view';
import DirGridView from './dir-grid-view';
import { SIDE_PANEL_FOLDED_WIDTH } from '../../constants';
const propTypes = {
isSidePanelFolded: PropTypes.bool,
isTreePanelShown: PropTypes.bool.isRequired,
currentMode: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
@@ -99,7 +101,9 @@ class DirColumnView extends React.Component {
};
onResizeMouseMove = (e) => {
let sizeNavWidth = this.containerWidth / 0.78 * 0.22 + 3;
const { isSidePanelFolded } = this.props;
let sizeNavWidth = isSidePanelFolded ? SIDE_PANEL_FOLDED_WIDTH + 3 : this.containerWidth / 0.78 * 0.22 + 3;
let rate = (e.nativeEvent.clientX - sizeNavWidth) / this.containerWidth;
if (rate < 0.1) {
this.setState({