fix(splitView): disable menu toggles on exposed aside

Closes #2182
This commit is contained in:
Adam Bradley
2014-09-11 22:05:46 -05:00
parent 8b1245feb7
commit ed3e9e30ce
3 changed files with 35 additions and 5 deletions

View File

@@ -50,6 +50,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody) {
* Toggle the left menu to open 100%
*/
self.toggleLeft = function(shouldOpen) {
if(isAsideExposed) return;
var openAmount = self.getOpenAmount();
if (arguments.length === 0) {
shouldOpen = openAmount <= 0;
@@ -66,6 +67,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody) {
* Toggle the right menu to open 100%
*/
self.toggleRight = function(shouldOpen) {
if(isAsideExposed) return;
var openAmount = self.getOpenAmount();
if (arguments.length === 0) {
shouldOpen = openAmount >= 0;
@@ -82,7 +84,6 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody) {
* Close all menus.
*/
self.close = function() {
if(isAsideExposed) return;
self.openPercentage(0);
};
@@ -258,6 +259,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody) {
};
self.exposeAside = function(shouldExposeAside) {
self.close();
isAsideExposed = shouldExposeAside;
// set the left marget width if it should be exposed