mobile swipe-in sidemenu for acp

v1.18.x
psychobunny 10 years ago
parent 95740ae8f9
commit 4b5112e60a

@ -32,6 +32,31 @@
color: #fff;
}
&.mobile {
#content {
padding-left: 20px;
}
#main-menu {
width: 200px;
height: 100%;
-webkit-transform: translateX(-190px);
transform: translateX(-190px);
&.transitioning {
.transition(.3s ease all);
}
&.open {
-webkit-transform: translateX(0);
transform: translateX(0);
}
}
}
#main-menu {
position: fixed;
width: 200px;

@ -7,6 +7,8 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {
$(document).ready(function() {
if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
getSearchIndex();
} else {
activateMobile();
}
$(window).on('action:ajaxify.end', function(ev, data) {
@ -18,6 +20,24 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {
setupMainMenu();
});
function activateMobile() {
$('.admin').addClass('mobile');
$('#main-menu').addClass('transitioning');
Hammer(document.body).on('swiperight', function(e) {
$('#main-menu').addClass('open');
});
Hammer(document.body).on('swipeleft', function(e) {
$('#main-menu').removeClass('open');
});
$(window).on('scroll', function() {
$('#main-menu').height($(window).height() + 20);
})
}
function setupMainMenu() {
$('.sidebar-nav .nav-header').on('click', function() {
$(this).parents('.sidebar-nav').toggleClass('open');

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save