support swipe to show and collapse siderbar

This commit is contained in:
MaysWind 2016-05-23 22:16:40 +08:00
parent 62ee432fd5
commit 8b5e17fa98
2 changed files with 9 additions and 1 deletions

View file

@ -26,7 +26,7 @@
<!-- endbuild -->
</head>
<body class="hold-transition skin-aria-ng sidebar-mini fixed">
<div class="wrapper" ng-controller="MainController">
<div class="wrapper" ng-controller="MainController" ng-swipe-left="hideSidebar()" ng-swipe-right="showSidebar()" ng-swipe-disable-mouse>
<header class="main-header">
<a class="logo" href="#">
<span class="logo-mini">Aria</span>

View file

@ -47,6 +47,14 @@
}
};
$scope.showSidebar = function () {
angular.element('body').removeClass('sidebar-collapse').addClass('sidebar-open');
};
$scope.hideSidebar = function () {
angular.element('body').addClass('sidebar-collapse').removeClass('sidebar-open');
};
if (ariaNgSettingService.getGlobalStatRefreshInterval() > 0) {
globalStatRefreshPromise = $interval(function () {
refreshGlobalStat();