Skip to content

Commit 04c7855

Browse files
change toggle icon position on mobile
1 parent 6196e43 commit 04c7855

File tree

3 files changed

+10
-25
lines changed

3 files changed

+10
-25
lines changed

themes/doc/lib/browser/navigation/components.jsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const React = require('react');
22

3-
function Navbar (props) {
3+
function Navbar(props) {
44
return (
55
<nav className="doc-navbar">
66
{props.children}
77
</nav>
88
);
99
}
1010

11-
function Logo ({page, url_for}) {
11+
function Logo({page, url_for}) {
1212
var homePath = page.lang === 'zh-cn' ? 'zh-cn/' : '/';
1313

1414
return (
@@ -246,16 +246,13 @@ function SidebarTocItem ({item, visibleHeaderId}) {
246246

247247
function SidebarToggle ({className, onClick}) {
248248
return (
249-
<i className={'dc-icon dc-icon--menu dc-icon--interactive doc-sidebar-toggle ' + (className || '')}
250-
onClick={onClick}>
251-
</i> );
249+
<i className={'dc-icon dc-icon--menu dc-icon--interactive doc-sidebar-toggle ' + (className || '')} onClick={onClick}/>
250+
);
252251
}
253252

254253
function SidebarClose ({className, onClick}) {
255254
return (
256-
<i className={'dc-icon dc-icon--close dc-icon--interactive doc-sidebar-close ' + (className || '')}
257-
onClick={onClick}>
258-
</i>
255+
<i className={'dc-icon dc-icon--close dc-icon--interactive doc-sidebar-close ' + (className || '')} onClick={onClick}/>
259256
);
260257
}
261258

themes/doc/lib/browser/navigation/containers.jsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,11 @@ class Navigation extends React.Component {
214214
render () {
215215
return (
216216
<div className="doc-navigation">
217-
<Navbar
218-
config={this.props.config}
219-
data={this.props.data}
220-
url_for={this.url_for}>
217+
<Navbar>
218+
<SidebarToggle className="doc-navbar__sidebar-toggle" onClick={this.toggleSidebar.bind(this)} />
221219
<Logo page={this.props.page} url_for={this.url_for} />
222-
<SidebarClose
223-
className="doc-navbar__sidebar-close doc-navbar__sidebar-close--desktop"
224-
onClick={this.collapseSidebar.bind(this)} />
225-
<SidebarToggle
226-
className="doc-navbar__sidebar-toggle"
227-
onClick={this.toggleSidebar.bind(this)} />
228-
<LangSwitcher
229-
page={this.props.page}
230-
url_for={this.url_for} />
220+
<SidebarClose className="doc-navbar__sidebar-close" onClick={this.collapseSidebar.bind(this)} />
221+
<LangSwitcher page={this.props.page} url_for={this.url_for} />
231222
</Navbar>
232223

233224
<Sidebar

themes/doc/source/style/_doc/navigation.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
}
7272

7373
&__sidebar-close {
74+
float: right;
7475
display: table;
7576
height: 100%;
7677
font-size: 12px;
@@ -80,10 +81,6 @@
8081
display: table-cell;
8182
vertical-align: middle;
8283
}
83-
}
84-
85-
&__sidebar-close--desktop {
86-
float: right;
8784

8885
@media screen and (max-width: $doc-breakpoint) {
8986
display: none

0 commit comments

Comments
 (0)