summaryrefslogtreecommitdiff
path: root/etc/js/ion-pullup.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2020-09-07 07:45:14 -0400
committerPliable Pixels <pliablepixels@gmail.com>2020-09-07 07:45:14 -0400
commit0170128d6abb193db01f37962d9aa51c2e39bad1 (patch)
treef8fef1eb390627a1230e4f2de81aee3d6e8314b8 /etc/js/ion-pullup.js
parent8e6aa82c09051862f6e3969b5935eafe98c32493 (diff)
make sure pullup directive cleans up resize listern
Diffstat (limited to 'etc/js/ion-pullup.js')
-rw-r--r--etc/js/ion-pullup.js7
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);