mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
40 lines
995 B
JavaScript
40 lines
995 B
JavaScript
(function() {
|
|
'use strict';
|
|
|
|
angular.module('ionic.ui.service.sideMenuDelegate', [])
|
|
|
|
.factory('$ionicSideMenuDelegate', ['$rootScope', '$timeout', '$q', function($rootScope, $timeout, $q) {
|
|
return {
|
|
getSideMenuController: function($scope) {
|
|
return $scope.sideMenuController;
|
|
},
|
|
close: function($scope) {
|
|
if($scope.sideMenuController) {
|
|
$scope.sideMenuController.close();
|
|
}
|
|
},
|
|
toggleLeft: function($scope) {
|
|
if($scope.sideMenuController) {
|
|
$scope.sideMenuController.toggleLeft();
|
|
}
|
|
},
|
|
toggleRight: function($scope) {
|
|
if($scope.sideMenuController) {
|
|
$scope.sideMenuController.toggleRight();
|
|
}
|
|
},
|
|
openLeft: function($scope) {
|
|
if($scope.sideMenuController) {
|
|
$scope.sideMenuController.openPercentage(100);
|
|
}
|
|
},
|
|
openRight: function($scope) {
|
|
if($scope.sideMenuController) {
|
|
$scope.sideMenuController.openPercentage(-100);
|
|
}
|
|
}
|
|
};
|
|
}]);
|
|
|
|
})();
|