diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2020-09-07 07:45:14 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2020-09-07 07:45:14 -0400 |
| commit | 0170128d6abb193db01f37962d9aa51c2e39bad1 (patch) | |
| tree | f8fef1eb390627a1230e4f2de81aee3d6e8314b8 /etc/js | |
| parent | 8e6aa82c09051862f6e3969b5935eafe98c32493 (diff) | |
make sure pullup directive cleans up resize listern
Diffstat (limited to 'etc/js')
| -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); |
