You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB
JavaScript

10 years ago
"use strict";
$(document).ready(function() {
setupSlideMenu();
function setupSlideMenu() {
$('[data-toggle="slide-in"]').on('click', function(ev) {
$('body').toggleClass('slide-in');
if ($('body').hasClass('slide-in')) {
var top = ($('html').scrollTop() || $('body').scrollTop()) + $('header-menu').height(),
transform = 'translate3d(0, ' + top + 'px, 0)';
$('#header-menu').css({
10 years ago
'-webkit-transform': transform,
'-moz-transform': transform,
'-ms-transform': transform,
'-o-transform': transform,
'transform': transform
});
10 years ago
$('html').css('overflow-y', 'hidden');
} else {
$('body').one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function() {
$('#header-menu').css({
10 years ago
'-webkit-transform': 'none',
'-moz-transform': 'none',
'-ms-transform': 'none',
'-o-transform': 'none',
'transform': 'none'
});
10 years ago
$('html').css('overflow-y', '');
10 years ago
});
}
});
$(window).on('action:ajaxify.start', function() {
if ($('body').hasClass('slide-in')) {
$('.navbar-header button').click();
}
});
10 years ago
}
10 years ago
});