Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit fa6eed4

Browse files
committed
Merge pull request #1538 from wesleycho/fix/resize-gc
fix: properly gc on destruction
2 parents d2f904a + 95692e7 commit fa6eed4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/uiSelectController.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,14 @@ uis.controller('uiSelectCtrl',
631631
}
632632
}
633633

634+
var onResize = $$uisDebounce(function() {
635+
ctrl.sizeSearchInput();
636+
}, 50);
637+
638+
angular.element($window).bind('resize', onResize);
639+
634640
$scope.$on('$destroy', function() {
635641
ctrl.searchInput.off('keyup keydown tagged blur paste');
642+
angular.element($window).off('resize', onResize);
636643
});
637-
638-
angular.element($window).bind('resize', $$uisDebounce(function() {
639-
ctrl.sizeSearchInput();
640-
}), 50);
641-
642644
}]);

0 commit comments

Comments
 (0)