1
0
mirror of https://github.com/hacks-guide/Guide_3DS.git synced 2025-08-29 11:19:56 +02:00

begin lang implementation

This commit is contained in:
Plailect
2017-01-15 01:06:59 -05:00
parent 410c792424
commit bab43f0b3b
8 changed files with 111 additions and 25 deletions

View File

@@ -6,15 +6,15 @@
*/
var $nav = $('#site-nav');
var $btn = $('#site-nav button');
var $btn = $('#site-nav #toggle-nav');
var $vlinks = $('#site-nav .visible-links');
var $hlinks = $('#site-nav .hidden-links');
var $hlinks = $('#site-nav .hidden-links.links-menu');
var breaks = [];
function updateNav() {
var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 30;
var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 80;
// The visible list is overflowing the nav
if($vlinks.width() > availableSpace) {
@@ -65,8 +65,28 @@ $(window).resize(function() {
});
$btn.on('click', function() {
$hlinks.toggleClass('hidden');
$(this).toggleClass('close');
if($hlinks.is(":visible")){
$hlinks.addClass('hidden');
$btn.removeClass('close');
} else {
$hlinks.removeClass('hidden');
$('.lang-menu').addClass('hidden');
$btn.addClass('close');
$('.lang-selector').removeClass('close');
}
});
// Language selector button
$('.lang-selector').on('click', function() {
if($('.lang-menu').is(":visible")){
$('.lang-menu').addClass('hidden');
$('.lang-selector').removeClass('close');
} else {
$('.lang-menu').removeClass('hidden');
$('.lang-selector').addClass('close');
$hlinks.addClass('hidden');
$btn.removeClass('close');
}
});
updateNav();