From 48ceaed751bd4bcf1e079b2014db0c48bec93268 Mon Sep 17 00:00:00 2001 From: Daniel <50356015+danny007in@users.noreply.github.com> Date: Fri, 27 Nov 2020 13:51:15 +0530 Subject: [PATCH] sidebar upgradeed (#3159) Removed Unnecessary Code And Sidebar improved (Can work smothly without overlayscroll plugin) --- build/js/Layout.js | 9 +++------ build/scss/_layout.scss | 2 +- build/scss/_main-sidebar.scss | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build/js/Layout.js b/build/js/Layout.js index c5c90e790..c79121334 100644 --- a/build/js/Layout.js +++ b/build/js/Layout.js @@ -32,7 +32,6 @@ const CLASS_NAME_SIDEBAR_FOCUSED = 'sidebar-focused' const CLASS_NAME_LAYOUT_FIXED = 'layout-fixed' const CLASS_NAME_CONTROL_SIDEBAR_SLIDE_OPEN = 'control-sidebar-slide-open' const CLASS_NAME_CONTROL_SIDEBAR_OPEN = 'control-sidebar-open' -const CLASS_NAME_LAYOUT_TOP_NAV = 'layout-top-nav' const Default = { scrollbarTheme: 'os-theme-light', @@ -84,11 +83,7 @@ class Layout { if (offset !== false) { if (max === heights.controlSidebar) { - if ($body.hasClass(CLASS_NAME_LAYOUT_TOP_NAV)) { - $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header - heights.footer) - } else { - $contentSelector.css(this._config.panelAutoHeightMode, (max + offset)) - } + $contentSelector.css(this._config.panelAutoHeightMode, (max + offset)) } else if (max === heights.window) { $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header - heights.footer) } else { @@ -121,6 +116,8 @@ class Layout { clickScrolling: true } }) + } else { + $(SELECTOR_SIDEBAR).css('overflow-y', 'auto') } } diff --git a/build/scss/_layout.scss b/build/scss/_layout.scss index cd7ecd9af..5cbd98aea 100644 --- a/build/scss/_layout.scss +++ b/build/scss/_layout.scss @@ -528,7 +528,7 @@ body:not(.sidebar-mini-md) { } } -:not(.layout-fixed) { +body:not(.layout-fixed) { .main-sidebar { height: inherit; min-height: 100%; diff --git a/build/scss/_main-sidebar.scss b/build/scss/_main-sidebar.scss index b14977302..0dbec5a9a 100644 --- a/build/scss/_main-sidebar.scss +++ b/build/scss/_main-sidebar.scss @@ -20,6 +20,7 @@ .sidebar { height: calc(100% - (#{$main-header-height-inner} + #{$main-header-bottom-border-width})); overflow-y: initial; + scrollbar-width: thin; padding-bottom: $sidebar-padding-y; padding-left: $sidebar-padding-x; padding-right: $sidebar-padding-x;