Replace the language selector by our custom dropdown menu
parent
26dd4ea11f
commit
569ea21705
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
globals define
|
|
||||||
*/
|
|
||||||
define([
|
|
||||||
'/customize/languageSelector.js',
|
|
||||||
'/customize/messages.js',
|
|
||||||
'/bower_components/jquery/dist/jquery.min.js'
|
|
||||||
], function (LS, Messages) {
|
|
||||||
var $ = window.jQuery;
|
|
||||||
var main = function () {
|
|
||||||
var url = window.location.pathname;
|
|
||||||
var isHtml = /\.html/.test(url) || url === '/' || url === '';
|
|
||||||
if (!isHtml) {
|
|
||||||
Messages._applyTranslation();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$.ajax({
|
|
||||||
url: isHtml ? '/customize/BottomBar.html' : '/customize/Header.html',
|
|
||||||
success: function (ret) {
|
|
||||||
var $bar = $(ret);
|
|
||||||
$('body').append($bar);
|
|
||||||
|
|
||||||
var $sel = $bar.find('#language-selector');
|
|
||||||
|
|
||||||
Object.keys(Messages._languages).forEach(function (code) {
|
|
||||||
$sel.append($('<option>', {
|
|
||||||
value: code,
|
|
||||||
}).text(Messages._languages[code]));
|
|
||||||
});
|
|
||||||
|
|
||||||
LS.main();
|
|
||||||
Messages._applyTranslation();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
main: main
|
|
||||||
};
|
|
||||||
});
|
|
@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
/* The container <div> - needed to position the dropdown content */
|
||||||
|
.dropdown-bar {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
.dropbtn {
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.dropbtn {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
.fa{
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-bar-content {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
min-width: 160px;
|
||||||
|
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2);
|
||||||
|
z-index: 1000;
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: black;
|
||||||
|
padding: 5px 16px;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
float: none;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
margin: 5px 0px;
|
||||||
|
height: 1px;
|
||||||
|
background: #bbb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue