mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Fix error switching index patterns in Discover (#9705)
Backports PR #9682
**Commit 1:**
Fix error switching index patterns in Discover
Needed to cleanup debounced function on scope destory.
Fixes https://github.com/elastic/kibana/issues/9681
* Original sha: f82624f7cd
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-12-29T22:29:40Z
This commit is contained in:
parent
4a586870c5
commit
b2ffc35741
1 changed files with 3 additions and 1 deletions
|
@ -117,11 +117,13 @@ uiModules
|
|||
}
|
||||
}
|
||||
|
||||
$scope.$watch(debounce(checkWidth, 100));
|
||||
const debouncedCheckWidth = debounce(checkWidth, 100);
|
||||
$scope.$watch(debouncedCheckWidth);
|
||||
|
||||
// cleanup when the scope is destroyed
|
||||
$scope.$on('$destroy', function () {
|
||||
cleanUp();
|
||||
debouncedCheckWidth.cancel();
|
||||
$scroller = $window = null;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue