Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node-slate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Hải Sơn
node-slate
Commits
1478579c
Commit
1478579c
authored
Jun 12, 2014
by
Robert Lord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add language tabs to navbar on phone
parent
d77f1e7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
30 deletions
+56
-30
lang.js
source/javascripts/app/lang.js
+3
-3
layout.erb
source/layouts/layout.erb
+12
-1
screen.css.scss
source/stylesheets/screen.css.scss
+41
-26
No files found.
source/javascripts/app/lang.js
View file @
1478579c
...
...
@@ -22,8 +22,8 @@ under the License.
function
activateLanguage
(
language
)
{
if
(
!
language
)
return
;
$
(
"
#
lang-selector a"
).
removeClass
(
'active'
);
$
(
"
#
lang-selector a[data-language-name='"
+
language
+
"']"
).
addClass
(
'active'
);
$
(
"
.
lang-selector a"
).
removeClass
(
'active'
);
$
(
"
.
lang-selector a[data-language-name='"
+
language
+
"']"
).
addClass
(
'active'
);
for
(
var
i
=
0
;
i
<
languages
.
length
;
i
++
)
{
$
(
".highlight."
+
languages
[
i
]).
hide
();
}
...
...
@@ -66,7 +66,7 @@ under the License.
// if we click on a language tab, activate that language
$
(
function
()
{
$
(
"
#
lang-selector a"
).
on
(
"click"
,
function
()
{
$
(
"
.
lang-selector a"
).
on
(
"click"
,
function
()
{
var
language
=
$
(
this
).
data
(
"language-name"
);
pushURL
(
language
);
activateLanguage
(
language
);
...
...
source/layouts/layout.erb
View file @
1478579c
...
...
@@ -47,6 +47,17 @@ under the License.
</a>
<div
class=
"tocify-wrapper"
>
<%=
image_tag
"logo.png"
%>
<%
if
language_tabs
%>
<div
class=
"lang-selector"
>
<%
language_tabs
.
each
do
|
lang
|
%>
<%
if
lang
.
is_a?
Hash
%>
<a
href=
"#"
data-language-name=
"
<%=
lang
.
keys
.
first
%>
"
>
<%=
lang
.
values
.
first
%>
</a>
<%
else
%>
<a
href=
"#"
data-language-name=
"
<%=
lang
%>
"
>
<%=
lang
%>
</a>
<%
end
%>
<%
end
%>
</div>
<%
end
%>
<%
if
current_page
.
data
.
search
%>
<div
class=
"search"
>
<input
type=
"text"
class=
"search"
id=
"input-search"
>
...
...
@@ -73,7 +84,7 @@ under the License.
</div>
<div
class=
"dark-box"
>
<%
if
language_tabs
%>
<div
id
=
"lang-selector"
>
<div
class
=
"lang-selector"
>
<%
language_tabs
.
each
do
|
lang
|
%>
<%
if
lang
.
is_a?
Hash
%>
<a
href=
"#"
data-language-name=
"
<%=
lang
.
keys
.
first
%>
"
>
<%=
lang
.
values
.
first
%>
</a>
...
...
source/stylesheets/screen.css.scss
View file @
1478579c
...
...
@@ -42,7 +42,7 @@ html, body {
////////////////////////////////////////////////////////////////////////////////
.tocify-wrapper
{
@include
transition
(
width
ease-in-out
0
.3s
);
@include
transition
(
left
ease-in-out
0
.3s
);
overflow-y
:
auto
;
overflow-x
:
hidden
;
position
:
fixed
;
...
...
@@ -55,6 +55,10 @@ html, body {
font-size
:
13px
;
font-weight
:
bold
;
.lang-selector
{
display
:
none
;
// only on mobile
}
// This is the logo at the top of the ToC
&
>
img
{
display
:
block
;
...
...
@@ -244,38 +248,41 @@ html, body {
bottom
:
0
;
}
#
lang-selector
{
.
lang-selector
{
position
:
fixed
;
width
:
100%
;
z-index
:
50
;
font-weight
:
bold
;
background-color
:
$lang-select-bg
;
border-bottom
:
5px
solid
$lang-select-active-bg
;
a
{
display
:
block
;
float
:left
;
color
:
$lang-select-text
;
text-decoration
:
none
;
padding
:
0
10px
;
line-height
:
30px
;
}
}
&
:active
{
background-color
:
$lang-select-pressed-bg
;
color
:
$lang-select-pressed-text
;
}
.lang-selector
{
background-color
:
$lang-select-bg
;
width
:
100%
;
font-weight
:
bold
;
a
{
display
:
block
;
float
:left
;
color
:
$lang-select-text
;
text-decoration
:
none
;
padding
:
0
10px
;
line-height
:
30px
;
&
.active
{
background-color
:
$lang-select-active-bg
;
color
:
$lang-select-active-text
;
}
&
:active
{
background-color
:
$lang-select-pressed-bg
;
color
:
$lang-select-pressed-text
;
}
&
:after
{
content
:
''
;
clear
:
both
;
display
:
block
;
&
.active
{
background-color
:
$lang-select-active-bg
;
color
:
$lang-select-active-text
;
}
}
&
:after
{
content
:
''
;
clear
:
both
;
display
:
block
;
}
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -534,10 +541,10 @@ html, body {
@media
(
max-width
:
$tablet-width
)
{
.tocify-wrapper
{
width
:
0
;
left
:
-
$nav-width
;
&
.open
{
width
:
$nav-width
;
left
:
0
;
}
}
...
...
@@ -559,6 +566,14 @@ html, body {
margin-right
:
0
;
}
.tocify-wrapper
.lang-selector
{
display
:
block
;
}
.page-wrapper
.lang-selector
{
display
:
none
;
}
%right-col
{
width
:
auto
;
float
:
none
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment