mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +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);
|
indexItem(node);
|
||||||
indexed[id] = true;
|
indexed[id] = true;
|
||||||
|
|
||||||
|
|
||||||
// If this node has children, index those
|
// If this node has children, index those
|
||||||
if (node && node.hasCapability && node.hasCapability('composition')) {
|
if (node && node.hasCapability && node.hasCapability('composition')) {
|
||||||
// Make sure that this is async, so doesn't block up page
|
// Make sure that this is async, so doesn't block up page
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
// Get the children...
|
// Get the children...
|
||||||
node.useCapability('composition').then(function (children) {
|
node.useCapability('composition').then(indexItems);
|
||||||
$timeout(function () {
|
}, 0, false);
|
||||||
// ... then index the children
|
|
||||||
if (children.constructor === Array) {
|
|
||||||
indexItems(children);
|
|
||||||
} else {
|
|
||||||
indexItems([children]);
|
|
||||||
}
|
|
||||||
}, 0);
|
|
||||||
});
|
|
||||||
}, 0);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user