mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
[Search] Don't trigger digest cycles while indexing
Avoid triggering digest cycles while indexing; remove extra call to $timeout
This commit is contained in:
parent
fe8543158e
commit
77c399f2a2
@ -126,23 +126,13 @@ define(
|
||||
indexItem(node);
|
||||
indexed[id] = true;
|
||||
|
||||
|
||||
// If this node has children, index those
|
||||
if (node && node.hasCapability && node.hasCapability('composition')) {
|
||||
// Make sure that this is async, so doesn't block up page
|
||||
$timeout(function () {
|
||||
// Get the children...
|
||||
node.useCapability('composition').then(function (children) {
|
||||
$timeout(function () {
|
||||
// ... then index the children
|
||||
if (children.constructor === Array) {
|
||||
indexItems(children);
|
||||
} else {
|
||||
indexItems([children]);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
}, 0);
|
||||
node.useCapability('composition').then(indexItems);
|
||||
}, 0, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user