/**
* @ngdoc service
* @name $ionicSideMenuDelegate
* @module ionic
*
* @description
* Delegate for controlling the {@link ionic.directive:ionSideMenus} directive.
*
* Methods called directly on the $ionicSideMenuDelegate service will control all side
* menus. Use the {@link ionic.service:$ionicSideMenuDelegate#$getByHandle $getByHandle}
* method to control specific ionSideMenus instances.
*
* @usage
*
* ```html
*
*
*
* Content!
*
*
*
* Left Menu!
*
*
*
* ```
* ```js
* function MainCtrl($scope, $ionicSideMenuDelegate) {
* $scope.toggleLeftSideMenu = function() {
* $ionicSideMenuDelegate.toggleLeft();
* };
* }
* ```
*/
IonicModule
.service('$ionicSideMenuDelegate', delegateService([
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#toggleLeft
* @description Toggle the left side menu (if it exists).
* @param {boolean=} isOpen Whether to open or close the menu.
* Default: Toggles the menu.
*/
'toggleLeft',
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#toggleRight
* @description Toggle the right side menu (if it exists).
* @param {boolean=} isOpen Whether to open or close the menu.
* Default: Toggles the menu.
*/
'toggleRight',
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#getOpenRatio
* @description Gets the ratio of open amount over menu width. For example, a
* menu of width 100 that is opened by 50 pixels is 50% opened, and would return
* a ratio of 0.5.
*
* @returns {float} 0 if nothing is open, between 0 and 1 if left menu is
* opened/opening, and between 0 and -1 if right menu is opened/opening.
*/
'getOpenRatio',
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#isOpen
* @returns {boolean} Whether either the left or right menu is currently opened.
*/
'isOpen',
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#isOpenLeft
* @returns {boolean} Whether the left menu is currently opened.
*/
'isOpenLeft',
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#isOpenRight
* @returns {boolean} Whether the right menu is currently opened.
*/
'isOpenRight',
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#canDragContent
* @param {boolean=} canDrag Set whether the content can or cannot be dragged to open
* side menus.
* @returns {boolean} Whether the content can be dragged to open side menus.
*/
'canDragContent'
/**
* @ngdoc method
* @name $ionicSideMenuDelegate#$getByHandle
* @param {string} handle
* @returns `delegateInstance` A delegate instance that controls only the
* {@link ionic.directive:ionSideMenus} directives with `delegate-handle` matching
* the given handle.
*
* Example: `$ionicSideMenuDelegate.$getByHandle('my-handle').toggleLeft();`
*/
]));