diff options
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/js/ion-pullup.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/js/ion-pullup.js b/etc/js/ion-pullup.js index 9c0b2470..723456f2 100644 --- a/etc/js/ion-pullup.js +++ b/etc/js/ion-pullup.js @@ -212,7 +212,12 @@ angular.module('ionic-pullup', []) } }; + function cleanup() { + $window.removeEventListener('orientationchange', updateUI); + deregisterWatch(); + } var deregisterWatch = $scope.$watch('state', function (newState, oldState) { + if (oldState === undefined || newState == oldState) return; switch (newState) { case FooterState.COLLAPSED: @@ -228,7 +233,7 @@ angular.module('ionic-pullup', []) $rootScope.$broadcast('ionPullUp:tap', $scope.state, footer.defaultBehavior); }); - $scope.$on('$destroy', deregisterWatch); + $scope.$on('$destroy', cleanup); $ionicPlatform.ready(function () { $window.addEventListener('orientationchange', updateUI); |
