Skip to content

Commit eaf0b22

Browse files
committed
Move language selection into the mobile menu (fixes bitcoin-dot-org#489)
1 parent ee8fa8c commit eaf0b22

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

_layouts/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
</div>
2828
{% endcase %}
2929
<div class="head"><div>
30-
<select id="langselect" class="langselect" onchange="window.location=this.value;">
31-
{% for lang in site.langsorder %}{% assign active = ''%}{% if lang == page.lang %}{% assign active = ' selected="selected"'%}{% endif %}
32-
<option value="/{{ lang }}/{% translate {{page.id}} url {{lang}} %}"{{ active }}>{{ site.langs[lang] }}</option>
33-
{% endfor %}
34-
</select>
3530
<ul class="lang">
3631
<li><a href="#" onclick="return false;">{{ site.langs[page.lang] }}</a>
3732
<ul>
@@ -47,6 +42,11 @@
4742
</ul>
4843
<a class="logo" href="/{{ page.lang }}/"><img src="/img/logotop.svg" alt="Bitcoin"></a>
4944
<a id="menumobile" class="menumobile" onclick="mobileMenuShow(event);" href="#"></a>
45+
<div id="langselect" class="langselect"><select onchange="window.location=this.value;">
46+
{% for lang in site.langsorder %}{% assign active = ''%}{% if lang == page.lang %}{% assign active = ' selected="selected"'%}{% endif %}
47+
<option value="/{{ lang }}/{% translate {{page.id}} url {{lang}} %}"{{ active }}>{{ site.langs[lang] }}</option>
48+
{% endfor %}
49+
</select></div>
5050
<ul id="menusimple" class="menusimple" onclick="mobileMenuHover(event);">
5151
<li><a href="#" onclick="return false;">{% translate menu-intro layout %}</a>
5252
<ul>

_less/rtl.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,14 @@ h2 .rssicon{
289289
h1{
290290
text-align:right;
291291
}
292+
.langselect{
293+
text-align:right;
294+
}
295+
.langselect select{
296+
text-align:right;
297+
margin-left:0;
298+
margin-right:10px;
299+
}
292300
.summary{
293301
text-align:right;
294302
}

_less/screen.less

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,14 +2031,21 @@ h2 .rssicon{
20312031
width:auto;
20322032
}
20332033
.langselect{
2034+
text-align:left;
2035+
background-color:#fff;
2036+
border-top:2px solid #ebebeb;
2037+
}
2038+
.langselect select{
2039+
text-align:left;
20342040
background-color:transparent;
20352041
border:0;
20362042
font-size:115%;
2037-
position:absolute;
2038-
right:-20px;
2039-
top:18px;
2040-
width:120px;
2041-
text-indent:20px;
2043+
padding:8px 0;
2044+
margin-top:12px;
2045+
margin-left:10px;
2046+
width:95%;
2047+
-webkit-appearance:none;
2048+
-moz-appearance:none;
20422049
}
20432050
.menumobile{
20442051
display:inline-block;
@@ -2053,12 +2060,12 @@ h2 .rssicon{
20532060
.lang,
20542061
.menusimple{
20552062
display:none;
2056-
}
2057-
.menusimple{
2063+
background-color:#fff;
20582064
position:static;
20592065
bottom:0;
2060-
margin:0 0 10px 0;
2066+
margin:0;
20612067
height:auto;
2068+
overflow:auto;
20622069
}
20632070
.menusimple li a,
20642071
.menusimple li ul li a,

js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ var mm=document.getElementById('menusimple');
168168
var ml=document.getElementById('langselect');
169169
var t=document.getElementById('menumobile');
170170
if(mm.style.display=='block'){mm.style.display='';ml.style.display='';}
171-
else{mm.style.display='block';ml.style.display='inline-block';}
171+
else{mm.style.display='block';ml.style.display='block';}
172172
t.parentNode.removeChild(t);
173173
cancelEvent(e);
174174
}

0 commit comments

Comments
 (0)