From 6d92ff6fb09538df141e7ea350a0269281760546 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 19 Aug 2019 11:37:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20Client=20=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment commit:6d30cd02d588f28c1c4d0d268fcb0f91ce978eca --- Bootstrap.Client/wwwroot/js/common-scripts.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Bootstrap.Client/wwwroot/js/common-scripts.js b/Bootstrap.Client/wwwroot/js/common-scripts.js index 58d9a144..e2ff8627 100644 --- a/Bootstrap.Client/wwwroot/js/common-scripts.js +++ b/Bootstrap.Client/wwwroot/js/common-scripts.js @@ -48,20 +48,8 @@ $(function () { // custom scrollbar var $sidebar = $('.sidebar').addNiceScroll().autoScrollSidebar({ target: arch.parent(), offsetTop: arch.parent().innerHeight() / 2 }); - - $sideMenu.on('click', 'a.dcjq-parent', function () { - return; - var $this = $(this); - if (!$.browser.versions.ios && $(window).width() > 768) { - setTimeout(function () { - var offsetScroll = parseInt($this.parents('.mCSB_container').css('top').replace('px', '')); - $sidebar.autoScrollSidebar({ target: $this.parent(), offsetTop: 25.5 - offsetScroll }); - }, 600); - } - else if ($.browser.versions.ios && $(window).width() > 768) { - var offsetScroll = parseInt($this.parents('aside').scrollTop()); - $sidebar.autoScrollSidebar({ target: $this.parent(), offsetTop: 25.5 + offsetScroll }); - } + $(window).on('resize', function () { + $sidebar.addNiceScroll(); }); $('.sidebar-toggle-box').on('click', function (e) {