MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / onLoad

Function onLoad

web/pgadmin/browser/static/js/browser.js:453–490  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

451 _findTreeChildNode: function(_i, _d, _o) {
452 let loaded = _o.t.wasLoad(_i),
453 onLoad = function() {
454 let items = _o.t.children(_i),
455 i, d, n, idx = 0, size = items.length;
456 for (; idx < size; idx++) {
457 i = items[idx];
458 d = _o.t.itemData(i);
459 if (d._type === _d._type) {
460 if (!_o.hasId || d._id == _d._id) {
461 _o.i = i;
462 _o.d = _d;
463 _o.pathOfTreeItems.push({coll: false, item: i, d: _d});
464
465 _o.success();
466 return;
467 }
468 } else {
469 n = _o.b.Nodes[d._type];
470 // Are we looking at the collection node for the given node?
471 if (
472 n?.collection_node && d.nodes &&
473 _.indexOf(d.nodes, _d._type) != -1
474 ) {
475 _o.i = i;
476 _o.d = null;
477 _o.pathOfTreeItems.push({coll: true, item: i, d: d});
478
479 // Set load to false when the current collection node's inode is false
480 if (!_o.t.isInode(i)) {
481 _o.load = false;
482 }
483 _o.b._findTreeChildNode(i, _d, _o);
484 return;
485 }
486 }
487 }
488 _o.notFound && typeof(_o.notFound) == 'function' &&
489 _o.notFound(_d);
490 };
491
492 if (!loaded && _o.load) {
493 _o.t.open(_i).then(

Callers 1

browser.jsFile · 0.85

Calls 4

successMethod · 0.80
isInodeMethod · 0.80
childrenMethod · 0.65
itemDataMethod · 0.65

Tested by

no test coverage detected