Commit 6893502beabdb7af40d153c7366b4a0087e258de
1 parent
51fabdf9
this is for mcustomscroll
Showing
2 changed files
with
12 additions
and
3 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -463,9 +463,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -463,9 +463,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
463 | 463 | ||
464 | //jspanel functionality.. | 464 | //jspanel functionality.. |
465 | 465 | ||
466 | - $rootScope.getSelectedModuleId = function (selectedModuleId) { | 466 | + $rootScope.getScrollModule = function () { |
467 | + $('.mCSB_container ul li').click(function () { | ||
468 | + | ||
469 | + $rootScope.scrollTopPosition = $(this).position().top; | ||
470 | + | ||
471 | + }); | ||
467 | setTimeout(function () { | 472 | setTimeout(function () { |
468 | - $(".sidebar").mCustomScrollbar("scrollTo", $("#" + selectedModuleId)); | 473 | + |
474 | + $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px"); | ||
475 | + | ||
476 | + | ||
477 | + | ||
469 | }, 300); | 478 | }, 300); |
470 | } | 479 | } |
471 | 480 |
400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | <div class="sidebar pull-left mCustomScrollbar _mCS_1 mCS-autoHide "> | 26 | <div class="sidebar pull-left mCustomScrollbar _mCS_1 mCS-autoHide "> |
27 | <!--{{name}}--> | 27 | <!--{{name}}--> |
28 | <ul class="nav nav-sidebar" ng-init="hideScrollbar()"> | 28 | <ul class="nav nav-sidebar" ng-init="hideScrollbar()"> |
29 | - <li ng-repeat="module in userModules"><a id="{{module.slug}}" href="{{module.slug}}" ng-click="IsVisible();getSelectedModuleId(module.slug)" data-ng-bind="module.name" ng-class="HightLightModuleSelection('{{module.slug}}')"><!--{{module.name}}--></a></li> | 29 | + <li ng-repeat="module in userModules"><a id="{{module.slug}}" href="{{module.slug}}" ng-click="IsVisible();getScrollModule()" data-ng-bind="module.name" ng-class="HightLightModuleSelection('{{module.slug}}')"><!--{{module.name}}--></a></li> |
30 | </ul> | 30 | </ul> |
31 | </div> | 31 | </div> |
32 | 32 |