refactor: 视频手机模式下侧边栏收起状态

This commit is contained in:
Argo Zhang 2019-08-17 20:37:32 +08:00
parent 493375288e
commit 7c4df7eb19
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
4 changed files with 14 additions and 5 deletions

View File

@ -17,7 +17,7 @@ namespace Bootstrap.Admin.Models
Theme = DictHelper.RetrieveActiveTheme();
IsDemo = DictHelper.RetrieveSystemModel();
ShowCardTitle = DictHelper.RetrieveCardTitleStatus() ? "" : "no-card-header";
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "sidebar-open";
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "collapsed";
}
/// <summary>

View File

@ -1,5 +1,5 @@
@model NavigatorBarModel
<aside>
<aside class="@Model.ShowSideBar">
<div class="bg"></div>
<div class="nav-brand justify-content-center">
<a href="~/Admin/Index">

View File

@ -1,5 +1,4 @@
@model ModelBase
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
@ -14,7 +13,7 @@
<link href="../css/IE8.css" rel="stylesheet" />
<![endif]-->
</head>
<body class="@Model.ShowSideBar">
<body>
<!--[if lt IE 10 ]>
<div id="ieAlert" class="alert alert-danger alert-dismissible">
<div>当前浏览器版本太低不支持本系统请升级到至少IE10 <a href="../browser/IE10.exe" target="_blank">本地下载</a> <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">微软下载</a>或者使用Chrome浏览器 <a href="../browser/ChromeSetup.exe" target="_blank">本地下载</a></div>

View File

@ -200,6 +200,16 @@ $(function () {
}
});
// 大于 769 时考虑网站设置 收缩侧边栏
if($(window).width() > 769) {
var $ele = $('aside');
var collapsed = $ele.hasClass('collapsed');
if(collapsed) {
$('body').addClass('sidebar-open');
$ele.removeClass('collapsed');
}
}
$('.sidebar-toggle-box').on('click', function () {
$('body').toggleClass('sidebar-open');
});