[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:
Pete Richards 2017-07-04 17:03:25 -07:00
parent 34ef98e0cd
commit d82230dea4

View File

@ -83,13 +83,14 @@ define(
// Callback to fire after each timeout;
// update bounds and schedule another timeout
function onInterval() {
if (!active) {
return;
}
fireEval({
width: element[0].offsetWidth,
height: element[0].offsetHeight
});
if (active) {
$timeout(onInterval, currentInterval(), false);
}
$timeout(onInterval, currentInterval(), false);
}
// Stop running in the background