From 592bc6f7211c20d7737b3d7daea4451802df3997 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Wed, 9 Nov 2016 20:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=B0=8F=E5=B1=8F=E5=B9=95=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=98=BE=E7=A4=BA=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Bootstrap.Admin.csproj | 1 + .../Content/css/admin-responsive.css | 71 +++++++++++++++++ Bootstrap.Admin/Content/css/admin.css | 17 ++-- .../Content/css/site-responsive.css | 79 +------------------ Bootstrap.Admin/Content/js/common-scripts.js | 40 +--------- Bootstrap.Admin/Views/Shared/Navigator.cshtml | 4 +- Bootstrap.Admin/Views/Shared/_Admin.cshtml | 3 +- 7 files changed, 91 insertions(+), 124 deletions(-) create mode 100644 Bootstrap.Admin/Content/css/admin-responsive.css diff --git a/Bootstrap.Admin/Bootstrap.Admin.csproj b/Bootstrap.Admin/Bootstrap.Admin.csproj index e932ad0f..862e040e 100644 --- a/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -100,6 +100,7 @@ + diff --git a/Bootstrap.Admin/Content/css/admin-responsive.css b/Bootstrap.Admin/Content/css/admin-responsive.css new file mode 100644 index 00000000..63f2fc6b --- /dev/null +++ b/Bootstrap.Admin/Content/css/admin-responsive.css @@ -0,0 +1,71 @@ +@media (min-width: 990px) { + .modal-dialog { + width: 800px; + } +} + +@media (max-width: 768px) { + #sidebar { + display: none; + overflow-y: auto; + position: absolute; + width: auto; + padding-right: 20px; + z-index: 2; + } + + #main-content { + margin-left: 0; + } + + .bs-bars { + display: none; + } + + .toolbar { + display: inline-block; + } + + .modal-dialog { + width: 540px; + } + + .fb-timeliner { + display: none; + } + + .icon-body { + margin-right: 0 !important; + } + + .modal-body div.checkbox { + min-width: 190px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .modal-body .checkbox label input[type='checkbox'] { + top: 4px; + } +} + +@media (max-width: 548px) { + .modal-dialog { + width: 460px; + } +} + +@media (max-width: 480px) { + .modal-dialog { + width: 300px; + } +} + +@media (min-height: 700px) { + #sidebar { + padding-top: 94px; + height: 100%; + padding-bottom: 54px; + } +} diff --git a/Bootstrap.Admin/Content/css/admin.css b/Bootstrap.Admin/Content/css/admin.css index 8c8ad3de..2ea49f08 100644 --- a/Bootstrap.Admin/Content/css/admin.css +++ b/Bootstrap.Admin/Content/css/admin.css @@ -1,9 +1,4 @@ -#main-content { - margin-left: 210px; - height: auto; -} - -.has-error input { +.has-error input { background-repeat: no-repeat; background-image: url('../images/error.png'); background-position: right 8px center; @@ -23,16 +18,18 @@ border-color: #3c763d; } -.sidebar-closed > #sidebar > ul { - display: none; + +#main-content { + margin-left: 210px; + height: auto; } .sidebar-closed #main-content { - margin-left: 0px; + margin-left: 0; } .sidebar-closed #sidebar { - margin-left: -210px; + display: none !important; } #sidebar { diff --git a/Bootstrap.Admin/Content/css/site-responsive.css b/Bootstrap.Admin/Content/css/site-responsive.css index e8b622c2..fc6cd773 100644 --- a/Bootstrap.Admin/Content/css/site-responsive.css +++ b/Bootstrap.Admin/Content/css/site-responsive.css @@ -1,56 +1,7 @@ -@media (min-width: 990px) { - .modal-dialog { - width: 800px; - } -} - -@media (max-width: 990px) { -} - -@media (min-width: 768px) { -} - -@media (max-width: 768px) { - .modal-dialog { - width: 540px; - } - - .sidebar-close #sidebar { - height: auto; - overflow: hidden; - overflow-y: auto; - position: absolute; - z-index: 1; - display: block; - padding-bottom: inherit; - } - - #sidebar { - display: none; - } - - #main-content { +@media (max-width: 930px) { + /*#main-content { margin: 0px !important; - } - - .fb-timeliner { - display: none; - } - - .icon-body { - margin-right: 0 !important; - } - - .modal-body div.checkbox { - min-width: 190px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - .modal-body .checkbox label input[type='checkbox'] { - top: 4px; - } + }*/ } @media (max-width: 666px) { @@ -63,18 +14,6 @@ .top-menu .search { display: none; } - - .modal-dialog { - width: 460px; - } - - .bs-bars { - display: none; - } - - .toolbar { - display: inline-block; - } } @media (max-width: 480px) { @@ -82,10 +21,6 @@ display: none; } - .modal-dialog { - width: 300px; - } - .top-menu > li { float: right; } @@ -99,18 +34,12 @@ } } -@media (min-height: 600px) { +@media (min-height: 700px) { html, body { height: 100%; overflow: hidden; } - #sidebar { - padding-top: 94px; - height: 100%; - padding-bottom: 54px; - } - .header { position: fixed; top: 0; diff --git a/Bootstrap.Admin/Content/js/common-scripts.js b/Bootstrap.Admin/Content/js/common-scripts.js index 89dab3a9..ce48540c 100644 --- a/Bootstrap.Admin/Content/js/common-scripts.js +++ b/Bootstrap.Admin/Content/js/common-scripts.js @@ -11,27 +11,9 @@ $(function () { // cookie: 'dcjq-accordion-1', classExpand: 'dcjq-current-parent' }); - //$.slidebars(); - - // sidebar toggle - function responsiveView() { - var wSize = $(window).width(); - if (wSize <= 768) { - $('#container').addClass('sidebar-close'); - $('#sidebar > ul').hide(); - } - - if (wSize > 768) { - $('#container').removeClass('sidebar-close'); - $('#sidebar > ul').show(); - } - } - $(window).on('load', responsiveView); - $(window).on('resize', responsiveView); }); (function ($) { - // sidebar dropdown menu auto scrolling $('#sidebar .sub-menu > a').click(function () { var o = ($(this).offset()); @@ -43,25 +25,11 @@ $(function () { }); $('.sidebar-toggle-box').click(function () { - - if ($('#sidebar > ul').is(":visible") === true) { - $('#main-content').css({ - 'margin-left': '0px' - }); - $('#sidebar').css({ - 'margin-left': '-210px' - }); - $('#sidebar > ul').hide(); - $("#container").addClass("sidebar-closed"); + if ($('#sidebar').is(":visible") === true) { + $(".sidebar").addClass("sidebar-closed"); } else { - $('#main-content').css({ - 'margin-left': '210px' - }); - $('#sidebar > ul').show(); - $('#sidebar').css({ - 'margin-left': '0' - }); - $("#container").removeClass("sidebar-closed"); + $(".sidebar").removeClass("sidebar-closed"); + $("#sidebar").show(); } }); diff --git a/Bootstrap.Admin/Views/Shared/Navigator.cshtml b/Bootstrap.Admin/Views/Shared/Navigator.cshtml index d8e8c4ea..8069cc10 100644 --- a/Bootstrap.Admin/Views/Shared/Navigator.cshtml +++ b/Bootstrap.Admin/Views/Shared/Navigator.cshtml @@ -1,13 +1,13 @@ @model NavigatorBarModel