1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

[draft view] removed the vertical resizer between the main panel & the side panel

This commit is contained in:
llj
2022-04-12 14:23:19 +08:00
parent 7f976c2073
commit 6999d3be76
2 changed files with 5 additions and 40 deletions

View File

@@ -16,8 +16,6 @@
height: 100%; height: 100%;
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between;
box-sizing: border-box;
background-color: #fafaf9; background-color: #fafaf9;
} }
@@ -29,20 +27,10 @@
.main .cur-view-right-part { .main .cur-view-right-part {
height: 100%; height: 100%;
width: 300px; width: 300px;
flex-shrink: 0;
position: relative; position: relative;
} }
.seafile-comment-resize {
width: 5px;
height: 100%;
background-color: transparent;
position: absolute;
left: 0;
top: 0;
cursor: col-resize;
z-index: 1;
}
.cur-file-info .file-info { .cur-file-info .file-info {
display: block; display: block;
padding-top: 10px; padding-top: 10px;

View File

@@ -53,8 +53,6 @@ class Draft extends React.Component {
historyList: [], historyList: [],
showReviewerDialog: false, showReviewerDialog: false,
reviewers: [], reviewers: [],
inResizing: false,
rightPartWidth: 300 / window.innerWidth * 100,
draftStatus: draftStatus, draftStatus: draftStatus,
}; };
this.quote = ''; this.quote = '';
@@ -561,25 +559,6 @@ class Draft extends React.Component {
this.oldIndex = node.data['old_index']; this.oldIndex = node.data['old_index'];
} }
onResizeMouseUp = () => {
if (this.state.inResizing) {
this.setState({ inResizing: false });
}
}
onResizeMouseDown = () => {
this.setState({ inResizing: true });
};
onResizeMouseMove = (e) => {
let rate = 100 - e.nativeEvent.clientX / this.refs.main.clientWidth * 100;
if (rate < 20 || rate > 60) {
this.setState({ inResizing: false });
return null;
}
this.setState({ rightPartWidth: rate });
};
componentDidMount() { componentDidMount() {
this.getOriginRepoInfo(); this.getOriginRepoInfo();
this.getDraftInfo(); this.getDraftInfo();
@@ -660,7 +639,6 @@ class Draft extends React.Component {
render() { render() {
const { draftInfo, reviewers, originRepoName, draftStatus } = this.state; const { draftInfo, reviewers, originRepoName, draftStatus } = this.state;
const onResizeMove = this.state.inResizing ? this.onResizeMouseMove : null;
const draftLink = siteRoot + 'lib/' + draftRepoID + '/file' + draftFilePath + '?mode=edit'; const draftLink = siteRoot + 'lib/' + draftRepoID + '/file' + draftFilePath + '?mode=edit';
const showPublishedButton = this.state.draftStatus == 'published'; const showPublishedButton = this.state.draftStatus == 'published';
const showPublishButton = this.state.draftStatus == 'open' && filePermission == 'rw'; const showPublishButton = this.state.draftStatus == 'open' && filePermission == 'rw';
@@ -706,8 +684,8 @@ class Draft extends React.Component {
</div> </div>
</div> </div>
<div id="main" className="main" ref="main"> <div id="main" className="main" ref="main">
<div className="cur-view-container" onMouseMove={onResizeMove} onMouseUp={this.onResizeMouseUp} > <div className="cur-view-container">
<div className='cur-view-content' ref="viewContent" style={{width:(100 - this.state.rightPartWidth) + '%'}}> <div className='cur-view-content' ref="viewContent">
{this.state.isLoading ? {this.state.isLoading ?
<div className="markdown-viewer-render-content article"> <div className="markdown-viewer-render-content article">
<Loading /> <Loading />
@@ -718,8 +696,7 @@ class Draft extends React.Component {
</div> </div>
} }
</div> </div>
<div className="cur-view-right-part" style={{width:(this.state.rightPartWidth) + '%'}}> <div className="cur-view-right-part">
<div className="seafile-comment-resize" onMouseDown={this.onResizeMouseDown}></div>
<div className="review-side-panel"> <div className="review-side-panel">
{this.renderNavItems()} {this.renderNavItems()}
<TabContent activeTab={this.state.activeTab}> <TabContent activeTab={this.state.activeTab}>