mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Resize] don't trigger callback when destroyed
Prevent MCTResize from triggering a callback after it is destroyed. Fixes https://github.com/nasa/openmct/issues/1509
This commit is contained in:
@ -83,14 +83,15 @@ define(
|
|||||||
// Callback to fire after each timeout;
|
// Callback to fire after each timeout;
|
||||||
// update bounds and schedule another timeout
|
// update bounds and schedule another timeout
|
||||||
function onInterval() {
|
function onInterval() {
|
||||||
|
if (!active) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
fireEval({
|
fireEval({
|
||||||
width: element[0].offsetWidth,
|
width: element[0].offsetWidth,
|
||||||
height: element[0].offsetHeight
|
height: element[0].offsetHeight
|
||||||
});
|
});
|
||||||
if (active) {
|
|
||||||
$timeout(onInterval, currentInterval(), false);
|
$timeout(onInterval, currentInterval(), false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Stop running in the background
|
// Stop running in the background
|
||||||
function deactivate() {
|
function deactivate() {
|
||||||
|
Reference in New Issue
Block a user