main
barisusakli 10 years ago
parent 5d1e3bd198
commit 561669fcb4

@ -1,8 +1,17 @@
#menu {
.slideout-menu {
position: fixed;
left: auto;
top: 0;
bottom: 0;
right: 0;
z-index: 0;
width: 256px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
display: none; display: none;
} }
@media (max-width: 980px) { @media (max-width: 980px) {
body { body {
padding-top: 0; padding-top: 0;
@ -20,6 +29,7 @@
} }
#menu { #menu {
padding-top: 100px; padding-top: 100px;
background-color: #1D1F20; background-color: #1D1F20;
background-image: linear-gradient(145deg, #1D1F20, #404348); background-image: linear-gradient(145deg, #1D1F20, #404348);
@ -69,7 +79,7 @@
.counter { .counter {
font-style: normal; font-style: normal;
&:after { &:after {
left: 5px; left: 5px;
top: -1px; top: -1px;
@ -120,19 +130,6 @@
} }
} }
.slideout-menu {
position: fixed;
left: auto;
top: 0;
bottom: 0;
right: 0;
z-index: 0;
width: 256px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
display: none;
}
.slideout-panel { .slideout-panel {
position: relative; position: relative;
z-index: 1; z-index: 1;
@ -148,7 +145,7 @@
.slideout-open .slideout-menu { .slideout-open .slideout-menu {
display: block; display: block;
} }
.slideout-open { .slideout-open {
overflow-y: hidden; overflow-y: hidden;
height: 100%; height: 100%;

File diff suppressed because one or more lines are too long

@ -92,6 +92,8 @@ $(document).ready(function() {
return; return;
} }
$('#menu').removeClass('hidden');
var slideout = new Slideout({ var slideout = new Slideout({
'panel': document.getElementById('panel'), 'panel': document.getElementById('panel'),
'menu': document.getElementById('menu'), 'menu': document.getElementById('menu'),
@ -101,7 +103,6 @@ $(document).ready(function() {
}); });
$('#mobile-menu').on('click', function() { $('#mobile-menu').on('click', function() {
$('#menu').show();
slideout.toggle(); slideout.toggle();
}); });
@ -109,11 +110,7 @@ $(document).ready(function() {
slideout.close(); slideout.close();
}); });
$(window).on('resize', function() { $(window).on('resize action:ajaxify.start', function() {
slideout.close();
});
$(window).on('action:ajaxify.start', function() {
slideout.close(); slideout.close();
}); });
@ -123,8 +120,6 @@ $(document).ready(function() {
} }
function openingMenu() { function openingMenu() {
$('#menu').show();
$('#header-menu').css({ $('#header-menu').css({
'top': $(window).scrollTop() + 'px', 'top': $(window).scrollTop() + 'px',
'position': 'absolute' 'position': 'absolute'
@ -140,9 +135,12 @@ $(document).ready(function() {
}); });
} }
slideout.on('beforeopen', openingMenuAndLoad);
slideout.on('open', openingMenuAndLoad); slideout.on('open', openingMenuAndLoad);
slideout.on('translate', openingMenu); slideout.on('touchmove', function(target) {
if (target && $(target).is('code')) {
slideout._preventOpen = true;
}
});
slideout.on('close', function() { slideout.on('close', function() {
$('#header-menu').css({ $('#header-menu').css({
@ -150,7 +148,6 @@ $(document).ready(function() {
'position': 'fixed' 'position': 'fixed'
}); });
$('.slideout-open').removeClass('slideout-open'); $('.slideout-open').removeClass('slideout-open');
$('#menu').hide();
}); });
$('#menu [data-section="navigation"] ul').html($('#main-nav').html() + ($('#logged-out-menu').html() || '')); $('#menu [data-section="navigation"] ul').html($('#main-nav').html() + ($('#logged-out-menu').html() || ''));

@ -38,7 +38,7 @@
</head> </head>
<body> <body>
<nav id="menu"> <nav id="menu" class="hidden">
<section class="menu-profile"> <section class="menu-profile">
<img src="{user.picture}"/> <img src="{user.picture}"/>
<i component="user/status" class="fa fa-fw fa-circle status {user.status}"></i> <i component="user/status" class="fa fa-fw fa-circle status {user.status}"></i>

Loading…
Cancel
Save