diff --git a/frontend/src/components/search/search.js b/frontend/src/components/search/search.js index 866f9690d7..59c1e0eebe 100644 --- a/frontend/src/components/search/search.js +++ b/frontend/src/components/search/search.js @@ -1,5 +1,6 @@ -import React, { Component } from 'react'; +import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; +import MediaQuery from 'react-responsive'; import { siteRoot } from '../../utils/constants'; import SearchResultItem from './search-result-item'; import editorUtilities from '../../utils/editor-utilties'; @@ -22,7 +23,8 @@ class Search extends Component { isMaskShow: false, isResultShow: false, isResultGetted: false, - isCloseShow: false + isCloseShow: false, + isSearchInputShow: false, // for mobile }; this.inputValue = ''; this.source = null; // used to cancel request; @@ -161,7 +163,8 @@ class Search extends Component { isCloseShow: false, isResultShow: false, isResultGetted: false, - resultItems: [] + resultItems: [], + isSearchInputShow: false, }); } @@ -212,33 +215,74 @@ class Search extends Component { ); } + onSearchToggle = () => { + this.setState({ + isSearchInputShow: !this.state.isSearchInputShow, + isMaskShow: !this.state.isMaskShow, + }); + } + render() { let width = this.state.width !== 'default' ? this.state.width : ''; let style = {'width': width}; return ( -
{gettext('Library Type')} | -+ | {gettext('Library Type')} | +
{gettext('Sort:')}
{gettext('name')} {this.props.sortBy === 'name' && sortIcon}
{gettext('last update')} {this.props.sortBy === 'time' && sortIcon}
@@ -117,10 +117,10 @@ class MylibRepoListView extends React.Component {
render() {
return (
{operations.map((item, index) => {
- return (
diff --git a/media/css/seahub_react.css b/media/css/seahub_react.css
index 8a67d2bc6c..024b3fb28b 100644
--- a/media/css/seahub_react.css
+++ b/media/css/seahub_react.css
@@ -210,8 +210,6 @@ ul,ol,li {
.side-nav-toggle { /* just for control side-panel */
margin-right:0.9375rem;
- height: 1.875rem;
- line-height: 1.875rem;
font-size:1.5rem;
color:#999;
cursor: pointer;
@@ -325,14 +323,14 @@ ul,ol,li {
.action-icon,
.attr-action-icon {
- color:#888;
+ color:#888 !important;
}
.action-icon:focus,
.action-icon:hover,
.attr-action-icon:focus,
.attr-action-icon:hover {
- color: #333;
+ color: #333 !important;
text-decoration: none;
}
@@ -785,11 +783,6 @@ a.sf-popover-item:hover {
.side-panel-top {
padding: .5rem 1rem;
}
-@media (max-width: 767px) {
- .side-panel-top {
- border-right: 1px solid #eee;
- }
-}
.side-panel-close {
margin:10px 0 0 auto;
}
@@ -905,6 +898,12 @@ table td {
color: green;
}
+@media (max-width: 767px) {
+ .rename-container input {
+ width: 10rem;
+ }
+}
+
/* table-item loading-more-data */
.list-show-more {
padding: 0.25rem 0.75rem;
@@ -1025,39 +1024,55 @@ a.table-sort-op:focus {
margin-left: 0.5rem;
}
-/* mobile menu */
-.item-meta-info {
- display: inline-block;
- margin-right: 8px;
- font-size: 12px;
- color: #666;
-}
-
-.mobile-operation-menu-bg-layer {
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- background: #000;
- opacity: 0.1;
- z-index: 3;
-}
-
-.mobile-operation-menu {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- padding: .5em 0;
- background: #fff;
- text-align: center;
- z-index: 4;
-}
-
/* thumbnail */
.thumbnail {
max-width: 24px;
max-height: 24px;
}
+@media (max-width: 767px) {
+ /* mobile menu */
+ .item-meta-info {
+ display: inline-block;
+ margin-right: 8px;
+ font-size: 12px;
+ color: #666;
+ }
+
+ .mobile-operation-menu-bg-layer {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ background: #000;
+ opacity: 0.1;
+ z-index: 3;
+ }
+
+ .mobile-operation-menu {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding: .5em 0;
+ background: #fff;
+ text-align: center;
+ z-index: 4;
+ }
+
+ /* toolbar icon */
+ .mobile-toolbar-icon {
+ color: #999;
+ font-size: 1.375rem;
+ margin-right: 0.5rem;
+ }
+
+ .mobile-menu-item {
+ color: #000;
+ line-height: 2rem;
+ font-size: 0.875rem;
+ }
+
+}
+
|
---|