mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
Style bug repair (#2394)
* optimized css code * repair search module * repair response bug * repair notificition bug * repair file-history bug * repair search info bug * optimized code
This commit is contained in:
committed by
Daniel Pan
parent
490a15deed
commit
5ce1b15fb2
@@ -21,18 +21,31 @@ class App extends Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
isOpen: false,
|
||||
isSidePanelClosed: false,
|
||||
};
|
||||
}
|
||||
|
||||
onCloseSidePanel = () => {
|
||||
this.setState({
|
||||
isSidePanelClosed: !this.state.isSidePanelClosed
|
||||
});
|
||||
}
|
||||
|
||||
onShowSidePanel = () => {
|
||||
this.setState({
|
||||
isSidePanelClosed: !this.state.isSidePanelClosed
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
let href = window.location.href.split('/');
|
||||
let currentTab = href[href.length - 2];
|
||||
|
||||
return (
|
||||
<div id="main">
|
||||
<SidePanel isOpen={this.state.isOpen} toggleClose={this.isOpen} currentTab={currentTab} />
|
||||
<SidePanel isSidePanelClosed={this.state.isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} />
|
||||
|
||||
<MainPanel path='/'>
|
||||
<MainPanel path='/' onShowSidePanel={this.onShowSidePanel}>
|
||||
<Router>
|
||||
<FilesActivities path='dashboard' />
|
||||
<DraftsView path='drafts' />
|
||||
|
@@ -45,7 +45,7 @@ class Notification extends React.Component {
|
||||
<div id="notice-popover" className={`sf-popover ${this.state.showNotice ? '': 'hide'}`}>
|
||||
<div className="outer-caret up-outer-caret"><div className="inner-caret"></div></div>
|
||||
<div className="sf-popover-hd ovhd">
|
||||
<h3 className="sf-popover-title">{gettext('Notifications')}</h3>
|
||||
<h3 className="sf-popover-title title">{gettext('Notifications')}</h3>
|
||||
<a href="#" onClick={this.onClick} title={gettext('Close')} aria-label={gettext('Close')} className="sf-popover-close js-close sf2-icon-x1 op-icon float-right"></a>
|
||||
</div>
|
||||
<div className="sf-popover-con">
|
||||
|
@@ -2,13 +2,6 @@ import React, { Component } from 'react';
|
||||
import CommonToolbar from './toolbar/common-toolbar';
|
||||
|
||||
class MainPanel extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
onMenuClick = () => {
|
||||
this.props.isOpen();
|
||||
}
|
||||
|
||||
onSearchedClick = () => {
|
||||
//todos;
|
||||
@@ -20,9 +13,9 @@ class MainPanel extends Component {
|
||||
<div className="main-panel o-hidden">
|
||||
<div className="main-panel-north">
|
||||
<div className="cur-view-toolbar">
|
||||
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.onMenuClick}></span>
|
||||
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span>
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.onSearchedClick}/>
|
||||
<CommonToolbar onSearchedClick={this.onSearchedClick} searchPlaceholder={'Search Files'}/>
|
||||
</div>
|
||||
<div className="main-panel-center">
|
||||
{this.props.children}
|
||||
|
@@ -205,7 +205,7 @@ class Search extends Component {
|
||||
onChange={this.onChangeHandler}
|
||||
autoComplete="off"
|
||||
/>
|
||||
<i className={`search-icon-right input-icon-addon fas fa-times ${this.state.isCloseShow ? "" : "hide"}`} onClick={this.onCloseHandler}></i>
|
||||
{this.state.isCloseShow && <i className='search-icon-right input-icon-addon fas fa-times' onClick={this.onCloseHandler}></i>}
|
||||
</div>
|
||||
<div className="search-result-container">
|
||||
{this.renderSearchResult()}
|
||||
|
@@ -6,15 +6,11 @@ import SideNavFooter from './side-nav-footer';
|
||||
|
||||
class SidePanel extends React.Component {
|
||||
|
||||
onCloseSidePanel = () => {
|
||||
//todos;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="side-panel">
|
||||
<div className={`side-panel ${this.props.isSidePanelClosed ? '' : 'left-zero'}`}>
|
||||
<div className="side-panel-north">
|
||||
<Logo onCloseSidePanel={this.onCloseSidePanel}/>
|
||||
<Logo onCloseSidePanel={this.props.onCloseSidePanel}/>
|
||||
</div>
|
||||
<div className="side-panel-center">
|
||||
<MainSideNav currentTab={this.props.currentTab}/>
|
||||
|
@@ -6,14 +6,15 @@ import Notification from '../common/notification';
|
||||
import Account from '../common/account';
|
||||
|
||||
const propTypes = {
|
||||
onSearchedClick: PropTypes.func.isRequired
|
||||
onSearchedClick: PropTypes.func.isRequired,
|
||||
searchPlaceholder: PropTypes.string
|
||||
};
|
||||
|
||||
class CommonToolbar extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="common-toolbar">
|
||||
{isPro && <Search onSearchedClick={this.props.onSearchedClick} placeholder={gettext("Search files")}/>}
|
||||
{isPro && <Search onSearchedClick={this.props.onSearchedClick} placeholder={gettext(this.props.searchPlaceholder)}/>}
|
||||
<Notification />
|
||||
<Account />
|
||||
</div>
|
||||
|
@@ -10,11 +10,10 @@
|
||||
position: relative;
|
||||
padding: .5rem 1rem;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
height: 2.5rem;
|
||||
font-size: 1rem;
|
||||
font-weight: normal;
|
||||
line-height: 1.5;
|
||||
height: 36px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
.side-panel {
|
||||
position:fixed;
|
||||
left:-300px;
|
||||
z-index:1; /* important! */
|
||||
z-index: 99; /* important! */
|
||||
width:300px;
|
||||
height:100%;
|
||||
background:#f8f8f8;
|
||||
@@ -47,9 +47,9 @@
|
||||
|
||||
.side-panel-north,
|
||||
.main-panel-north {
|
||||
padding: .5rem 1rem;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
padding: .5rem 1rem;
|
||||
background: #f4f4f7;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
@@ -68,43 +68,45 @@
|
||||
}
|
||||
|
||||
.cur-view-container {
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
flex:1 1 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 1 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cur-view-path {
|
||||
flex-shrink:0;
|
||||
min-height:40px;
|
||||
padding:8px 16px 0;
|
||||
position: relative; /* for the ':after' */
|
||||
padding: 8px 16px;
|
||||
max-height: 40px;
|
||||
background:#f9f9f9;
|
||||
position:relative; /* for the ':after' */
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cur-view-path:after {
|
||||
content:'';
|
||||
border-bottom:1px solid #e8e8e8;
|
||||
position:absolute;
|
||||
left:16px;
|
||||
right:16px;
|
||||
bottom:0;
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.cur-view-content {
|
||||
padding:10px 16px 20px;
|
||||
flex:1;
|
||||
padding: 10px 16px 20px;
|
||||
height: calc(100% - 40px);
|
||||
overflow:auto;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.cur-view-content .hd {
|
||||
padding-bottom:0;
|
||||
height:48px;
|
||||
padding:9px 10px;
|
||||
background:#f2f2f2;
|
||||
margin-bottom:.5em;
|
||||
border-radius:2px;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: .5em;
|
||||
height: 48px;
|
||||
padding: 9px 10px;
|
||||
background: #f2f2f2;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
[role=group] {
|
||||
|
@@ -54,7 +54,7 @@
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.common-toolbar div{
|
||||
.common-toolbar > div{
|
||||
margin-left: .5rem;
|
||||
}
|
||||
/* end common-toolbar */
|
||||
|
@@ -39,15 +39,6 @@
|
||||
padding: 30px 0 0;
|
||||
}
|
||||
|
||||
.wiki-main .cur-view-path {
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.wiki-main .cur-view-path::after {
|
||||
display:none;
|
||||
}
|
||||
|
||||
img[src=""] {
|
||||
opacity: 0;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ class MainPanel extends React.Component {
|
||||
Prism.highlightAll();
|
||||
}
|
||||
|
||||
onSelectedClick = () => {
|
||||
onSearchedClick = () => {
|
||||
//todos;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class MainPanel extends React.Component {
|
||||
return (
|
||||
<div className="main-panel viewer">
|
||||
<div className="main-panel-north">
|
||||
<CommonToolbar onSelectedClick={this.onSelectedClick} />
|
||||
<CommonToolbar onSearchedClick={this.onSearchedClick} />
|
||||
</div>
|
||||
<div className="main-panel-center history-viewer-contanier">
|
||||
<div className="content-viewer">
|
||||
|
@@ -66,23 +66,21 @@ class MainPanel extends Component {
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="wiki-main-panel o-hidden">
|
||||
<div className="main-panel wiki-main-panel o-hidden">
|
||||
<div className="main-panel-top panel-top">
|
||||
<div className="cur-view-toolbar border-left-show">
|
||||
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.onMenuClick}></span>
|
||||
<div>
|
||||
<span className="sf2-icon-menu hidden-md-up d-md-none side-nav-toggle" title={gettext('Side Nav Menu')} onClick={this.onMenuClick}></span>
|
||||
{
|
||||
this.props.permission === 'rw' &&
|
||||
<button className="btn btn-secondary top-toolbar-btn" title="Edit File" onClick={this.onEditClick}>{gettext("Edit")}</button>
|
||||
<button className="btn btn-secondary top-toolbar-btn" title={gettext('Edit File')} onClick={this.onEditClick}>{gettext("Edit")}</button>
|
||||
}
|
||||
</div>
|
||||
<div className="btn-group">
|
||||
<button className="btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-list-view" id='list' title={gettext("List")} onClick={this.switchViewMode}></button>
|
||||
<button className="btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-grid-view" id='grid' title={gettext("Grid")} onClick={this.switchViewMode}></button>
|
||||
<button className={`btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-wiki-view ${this.state.isWikiMode ? 'current-mode' : ''}`} id='wiki' title={gettext("wiki")} onClick={this.switchViewMode}></button>
|
||||
</div>
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.props.onSearchedClick} />
|
||||
<CommonToolbar onSearchedClick={this.props.onSearchedClick} searchPlaceholder={'Search files in this library'}/>
|
||||
</div>
|
||||
<div className="cur-view-container">
|
||||
<div className="cur-view-path">
|
||||
|
@@ -158,7 +158,7 @@ class SidePanel extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={`wiki-side-panel ${this.props.closeSideBar ? "": "left-zero"}`}>
|
||||
<div className={`side-panel wiki-side-panel ${this.props.closeSideBar ? "": "left-zero"}`}>
|
||||
<div className="side-panel-top panel-top">
|
||||
<a href={siteRoot} id="logo">
|
||||
<img src={mediaUrl + logoPath} title={siteTitle} alt="logo" width={logoWidth} height={logoHeight} />
|
||||
|
@@ -49,16 +49,16 @@ class MainPanel extends Component {
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="wiki-main-panel o-hidden">
|
||||
<div className="main-panel wiki-main-panel o-hidden">
|
||||
<div className="main-panel-top panel-top">
|
||||
<div className="cur-view-toolbar border-left-show">
|
||||
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.onMenuClick}></span>
|
||||
<span className="sf2-icon-menu hidden-md-up d-md-none side-nav-toggle" title="Side Nav Menu" onClick={this.onMenuClick}></span>
|
||||
{
|
||||
this.props.permission === 'rw' &&
|
||||
<button className="btn btn-secondary top-toolbar-btn" title="Edit File" onClick={this.onEditClick}>{gettext("Edit Page")}</button>
|
||||
}
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.props.onSearchedClick} />
|
||||
<CommonToolbar onSearchedClick={this.props.onSearchedClick} searchPlaceholder={'Search files in this library'}/>
|
||||
</div>
|
||||
<div className="cur-view-container">
|
||||
<div className="cur-view-path">
|
||||
|
@@ -158,7 +158,7 @@ class SidePanel extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={`wiki-side-panel ${this.props.closeSideBar ? "": "left-zero"}`}>
|
||||
<div className={`side-panel wiki-side-panel ${this.props.closeSideBar ? "": "left-zero"}`}>
|
||||
<div className="side-panel-top panel-top">
|
||||
<a href={siteRoot} id="logo">
|
||||
<img src={mediaUrl + logoPath} title={siteTitle} alt="logo" width={logoWidth} height={logoHeight} />
|
||||
|
@@ -2129,8 +2129,7 @@ button.sf-dropdown-toggle:focus {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
#notifications a {
|
||||
width: 100%;
|
||||
#notifications #notice-icon {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@@ -124,7 +124,7 @@ ul,ol,li {
|
||||
.up-outer-caret .inner-caret {
|
||||
border-bottom-color:#fff;
|
||||
top:1px;
|
||||
left:-18px;
|
||||
left:-10px;
|
||||
}
|
||||
.up-outer-caret {
|
||||
position:absolute;
|
||||
@@ -445,9 +445,12 @@ a.op-icon:focus {
|
||||
}
|
||||
|
||||
.side-nav-toggle {
|
||||
margin-right:0.9375rem;
|
||||
height: 1.875rem;
|
||||
line-height: 1.875rem;
|
||||
font-size:1.5rem;
|
||||
color:#999;
|
||||
margin-right:15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.side-panel-slide {
|
||||
transition: all .3s ease-in-out;
|
||||
@@ -537,6 +540,12 @@ a.op-icon:focus {
|
||||
}
|
||||
|
||||
/* notifications */
|
||||
#notifications .title {
|
||||
line-height: 1.5;
|
||||
font-size: 1rem;
|
||||
color: #322;
|
||||
font-weight: normal;
|
||||
}
|
||||
#notifications .sf2-icon-bell {
|
||||
font-size:24px;
|
||||
line-height:1;
|
||||
@@ -580,11 +589,16 @@ a.op-icon:focus {
|
||||
}
|
||||
#notice-popover .brief {
|
||||
margin-left:40px;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
#notice-popover .time {
|
||||
margin:0;
|
||||
color:#999;
|
||||
text-align:right;
|
||||
margin:0;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.5rem;
|
||||
clear:both;
|
||||
}
|
||||
#notice-popover .view-all {
|
||||
@@ -645,46 +659,6 @@ a.op-icon:focus {
|
||||
}
|
||||
|
||||
/* basic layout */
|
||||
#wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
#main {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.main-panel {
|
||||
flex: 1 0 75%;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
|
||||
.side-panel {
|
||||
flex: 0 0 25%;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
overflow:hidden;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.side-panel {
|
||||
background:#f8f8f8;
|
||||
width:300px;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
left:-300px;
|
||||
z-index:1; /* important! */
|
||||
-webkit-transition: all 0.3s ease;
|
||||
-moz-transition: all 0.3s ease;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
}
|
||||
.panel-top {
|
||||
padding:.5rem 1rem;
|
||||
background:#f4f4f7;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display:flex;
|
||||
flex-shrink:0;
|
||||
}
|
||||
.side-panel-top {
|
||||
padding: .5rem 1rem;
|
||||
}
|
||||
@@ -696,44 +670,10 @@ a.op-icon:focus {
|
||||
.side-panel-close {
|
||||
margin:10px 0 0 auto;
|
||||
}
|
||||
|
||||
.cur-view-main {
|
||||
flex:1 1 auto;
|
||||
.panel-top {
|
||||
padding:.5rem 1rem;
|
||||
background:#f4f4f7;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
.cur-view-path {
|
||||
flex-shrink:0;
|
||||
min-height:40px;
|
||||
padding:8px 16px 0;
|
||||
background:#f9f9f9;
|
||||
position:relative; /* for the ':after' */
|
||||
}
|
||||
.cur-view-path:after {
|
||||
content:'';
|
||||
border-bottom:1px solid #e8e8e8;
|
||||
position:absolute;
|
||||
left:16px;
|
||||
right:16px;
|
||||
bottom:0;
|
||||
}
|
||||
.cur-view-main-con {
|
||||
padding:10px 16px 20px;
|
||||
overflow:auto;
|
||||
flex:auto;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
.cur-view-main-con .hd {
|
||||
padding-bottom:0;
|
||||
height:48px;
|
||||
padding:9px 10px;
|
||||
background:#f2f2f2;
|
||||
margin-bottom:.5em;
|
||||
border-radius:2px;
|
||||
}
|
||||
.main-panel-main {
|
||||
flex:auto;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
overflow:hidden; /* for ff */
|
||||
}
|
||||
|
Reference in New Issue
Block a user