Skip to content

Commit

Permalink
fix(Side Menu): fix error on undefined scrollScope
Browse files Browse the repository at this point in the history
After navigating away from the view that contained the menu, the `scope()` function returns undefined, and an error is thrown trying to freeze scroll.
  • Loading branch information
Merott committed Mar 15, 2016
1 parent 0c52778 commit de18df9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/angular/directive/sideMenuContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ function($timeout, $ionicGesture, $window) {

// freeze our scroll container if we have one
var scrollScope = content.scope();
scrollScope.scrollCtrl && scrollScope.scrollCtrl.freezeScrollShut(!canScroll);
scrollScope &&
scrollScope.scrollCtrl &&
scrollScope.scrollCtrl.freezeScrollShut(!canScroll);
},
getTranslateX: function() {
return $scope.sideMenuContentTranslateX || 0;
Expand Down

0 comments on commit de18df9

Please sign in to comment.