移动端登录不显示左侧菜单

master
RuoYi 5 years ago committed by Limy
parent fee7a85d69
commit d76adfc7a4

@ -7,6 +7,8 @@ layer.config({
skin: 'layer-ext-moon'
});
var isMobile = $.common.isMobile() || $(window).width() < 769;
$(function() {
// MetsiMenu
$('#side-menu').metisMenu();
@ -22,14 +24,19 @@ $(function() {
// 菜单切换
$('.navbar-minimalize').click(function() {
if (isMobile) {
$("body").toggleClass("canvas-menu");
} else {
$("body").toggleClass("mini-navbar");
}
SmoothlyMenu();
});
$('#side-menu>li').click(function() {
if ($('body').hasClass('mini-navbar')) {
if ($('body').hasClass('canvas-menu mini-navbar')) {
NavToggle();
}
});
$('#side-menu>li li a').click(function() {
if ($(window).width() < 769) {
@ -49,9 +56,8 @@ $(function() {
$(window).bind("load resize",
function() {
if ($(this).width() < 769) {
$('body').addClass('mini-navbar');
$('.navbar-static-side').fadeIn();
$(".sidebar-collapse .logo").addClass("hide");
$('body').addClass('canvas-menu');
$("nav .logo").addClass("hide");
$(".slimScrollDiv").css({ "overflow":"hidden" })
}
});
@ -60,21 +66,27 @@ function NavToggle() {
$('.navbar-minimalize').trigger('click');
}
function SmoothlyMenu() {
if (!$('body').hasClass('mini-navbar')) {
function fixedSidebar() {
$('#side-menu').hide();
$(".sidebar-collapse .logo").removeClass("hide");
$("nav .logo").addClass("hide");
setTimeout(function() {
$('#side-menu').fadeIn(500);
},
100);
} else if ($('body').hasClass('fixed-sidebar')) {
$('#side-menu').hide();
$(".sidebar-collapse .logo").addClass("hide");
setTimeout(function() {
$('#side-menu').fadeIn(500);
},
300);
}
function SmoothlyMenu() {
if (isMobile && !$('body').hasClass('canvas-menu')) {
$('.navbar-static-side').fadeIn();
fixedSidebar();
} else if (!isMobile &&!$('body').hasClass('mini-navbar')) {
fixedSidebar();
$("nav .logo").removeClass("hide");
} else if (isMobile && $('body').hasClass('fixed-sidebar')) {
$('.navbar-static-side').fadeOut();
fixedSidebar();
} else if (!isMobile && $('body').hasClass('fixed-sidebar')) {
fixedSidebar();
} else {
$('#side-menu').removeAttr('style');
}

@ -711,7 +711,7 @@ var table = {
// 弹出层指定宽度
open: function (title, url, width, height, callback) {
//如果是移动端,就使用自适应大小弹窗
if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
if ($.common.isMobile()) {
width = 'auto';
height = 'auto';
}
@ -783,7 +783,7 @@ var table = {
// 弹出层全屏
openFull: function (title, url, width, height) {
//如果是移动端,就使用自适应大小弹窗
if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
if ($.common.isMobile()) {
width = 'auto';
height = 'auto';
}
@ -896,7 +896,7 @@ var table = {
var _width = $.common.isEmpty(width) ? "800" : width;
var _height = $.common.isEmpty(height) ? ($(window).height() - 50) : height;
//如果是移动端,就使用自适应大小弹窗
if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
if ($.common.isMobile()) {
_width = 'auto';
_height = 'auto';
}
@ -1487,7 +1487,11 @@ var table = {
}  
}
return count;
}
},
// 判断移动端
isMobile: function () {
return navigator.userAgent.match(/(Android|iPhone|SymbianOS|Windows Phone|iPad|iPod)/i);
},
}
});
})(jQuery);

@ -26,7 +26,7 @@
<i class="fa fa-times-circle"></i>
</div>
<a th:href="@{/index}">
<li class="logo">
<li class="logo hidden-xs">
<span class="logo-lg">RuoYi</span>
</li>
</a>

Loading…
Cancel
Save