<div class="row">
<div class="col-lg-4">
<h3 i18n>Org Units</h3>
- <eg-tree [tree]="tree" (nodeClicked)="nodeClicked($event)"></eg-tree>
+ <div class="border rounded p-1" style="height:{{winHeight}}px;overflow-y:auto">
+ <eg-tree [tree]="tree" (nodeClicked)="nodeClicked($event)"></eg-tree>
+ </div>
</div>
<div class="col-lg-8">
<div class="alert alert-info">
tree: Tree;
selected: TreeNode;
+ winHeight = 500;
+
@ViewChild('editString', { static: true }) editString: StringComponent;
@ViewChild('errorString', { static: true }) errorString: StringComponent;
@ViewChild('delConfirm', { static: true }) delConfirm: ConfirmDialogComponent;
const node = this.tree.findNode(selectNodeId);
this.selected = node;
this.tree.selectNode(node);
+
+ // Subtract out the menu bar plus a bit more.
+ this.winHeight = window.innerHeight * 0.8;
});
}
// Translate the org unt type tree into a structure EgTree can use.
ingestAouTree(aouTree) {
- const handleNode = (orgNode: IdlObject): TreeNode => {
+ const handleNode = (orgNode: IdlObject, expand?: boolean): TreeNode => {
if (!orgNode) { return; }
if (!orgNode.hours_of_operation()) {
const treeNode = new TreeNode({
id: orgNode.id(),
label: orgNode.name(),
- callerData: {orgUnit: orgNode}
+ callerData: {orgUnit: orgNode},
+ expanded: expand
});
// Apply the compiled label asynchronously
return treeNode;
};
- const rootNode = handleNode(aouTree);
+ const rootNode = handleNode(aouTree, true);
this.tree = new Tree(rootNode);
}