@@ -121,7 +174,7 @@ class DirentDetail extends React.Component {
repoInfo={this.state.repoInfo}
path={this.props.path}
repoID={this.props.repoID}
- dirent={this.props.dirent}
+ dirent={this.props.dirent || folderDirent}
direntType={this.state.direntType}
direntDetail={this.state.direntDetail}
fileTagList={this.state.fileTagList}
diff --git a/frontend/src/components/toolbar/view-mode-toolbar.js b/frontend/src/components/toolbar/view-mode-toolbar.js
index f664519207..a83d84b38e 100644
--- a/frontend/src/components/toolbar/view-mode-toolbar.js
+++ b/frontend/src/components/toolbar/view-mode-toolbar.js
@@ -21,11 +21,16 @@ class ViewModeToolbar extends React.Component {
render() {
let baseClass = 'btn btn-secondary btn-icon sf-view-mode-btn ';
return (
-
-
- {/* */}
-
-
+
+
+
+ {/* */}
+
+
+
+
+
+
);
}
}
diff --git a/frontend/src/css/dirent-detail.css b/frontend/src/css/dirent-detail.css
index 59655c6fd6..61d836f2b6 100644
--- a/frontend/src/css/dirent-detail.css
+++ b/frontend/src/css/dirent-detail.css
@@ -13,6 +13,7 @@
line-height: 2.5rem;
background-color: #f9f9f9;
border-bottom: 1px solid #e8e8e8;
+ height: 40px;
}
.detail-header .detail-control {
diff --git a/frontend/src/css/layout.css b/frontend/src/css/layout.css
index b6a4e06eee..3c0677b15b 100644
--- a/frontend/src/css/layout.css
+++ b/frontend/src/css/layout.css
@@ -52,6 +52,7 @@
flex-shrink: 0;
background: #f4f4f7;
border-bottom: 1px solid #e8e8e8;
+ z-index: 100;
}
@media (max-width: 767px) {
@@ -140,8 +141,30 @@
}
.cur-view-detail {
- flex: 0 0 20rem;
- display: flex;
+ display: block;
+ position: absolute;
+ right: 0;
+ background-color: #fff;
+ width: 300px;
+ height: calc(100% - 50px);
+ box-shadow: -1px 0 3px 0 #ccc;
+ top: 49px;
+ animation: move .5s ease-in-out 1;
+}
+
+@keyframes move {
+ from {
+ right: -500px;
+ opacity: 0.5;
+ }
+ to {
+ right: 0px;
+ opacity: 1;
+ }
+}
+
+.cur-view-detail .detail-container {
+ height: 100%;
}
/* for reach/router */
diff --git a/frontend/src/css/toolbar.css b/frontend/src/css/toolbar.css
index 3e125d9f25..21af69c1a9 100644
--- a/frontend/src/css/toolbar.css
+++ b/frontend/src/css/toolbar.css
@@ -61,6 +61,11 @@
border-radius: 0 !important;
}
+.dirent-detail-btn .sf-view-mode-btn {
+ font-size: 15px;
+ border-radius: 3px !important;
+}
+
.sf-view-mode-btn.current-mode {
background-color: #ccc !important;
color: #fff !important;
diff --git a/frontend/src/pages/lib-content-view/lib-content-container.js b/frontend/src/pages/lib-content-view/lib-content-container.js
index b7dbf94587..30c31eba75 100644
--- a/frontend/src/pages/lib-content-view/lib-content-container.js
+++ b/frontend/src/pages/lib-content-view/lib-content-container.js
@@ -83,7 +83,7 @@ class LibContentContainer extends React.Component {
constructor(props) {
super(props);
this.state = {
- currentDirent: null,
+ currentDirent: {},
appMenuType: 'item_op_menu',
};
@@ -286,6 +286,7 @@ class LibContentContainer extends React.Component {
repoID={repoID}
path={this.props.path}
dirent={this.state.currentDirent}
+ currentRepoInfo={this.props.currentRepoInfo}
onItemDetailsClose={this.onItemDetailsClose}
onFileTagChanged={this.props.onFileTagChanged}
/>
diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js
index a5aa45f7d8..359c3f0e25 100644
--- a/frontend/src/pages/lib-content-view/lib-content-view.js
+++ b/frontend/src/pages/lib-content-view/lib-content-view.js
@@ -83,6 +83,10 @@ class LibContentView extends React.Component {
});
}
+ toggleDirentDetail = () => {
+ this.setState({ isDirentDetailShow: !this.state.isDirentDetailShow });
+ }
+
closeDirentDetail = () => {
this.setState({ isDirentDetailShow: false });
}
@@ -538,6 +542,10 @@ class LibContentView extends React.Component {
if (mode === this.state.currentMode) {
return;
}
+ if (mode === 'detail') {
+ this.toggleDirentDetail();
+ return;
+ }
cookie.save('seafile-view-mode', mode);
let path = this.state.path;
if (this.state.currentMode === 'column' && this.state.isViewFile) {