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.

31 lines
830 B
JavaScript

"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()
$('#header-menu').css('transform', 'translate3d(0, ' + top + 'px, 0)');
$('html').css('overflow-y', 'hidden');
} else {
$('body').one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function() {
$('#header-menu').css('transform', 'none');
$('html').css('overflow-y', '');
});
}
});
$(window).on('action:ajaxify.start', function() {
if ($('body').hasClass('slide-in')) {
$('.navbar-header button').click();
}
});
}
});