Browse Source

UI: Fixed changed event on customer hierarchy

pull/12888/head
Artem Dzhereleiko 2 years ago
parent
commit
bb3dd0054b
  1. 4
      ui-ngx/src/app/shared/components/nav-tree.component.ts
  2. 1
      ui-ngx/src/typings/jquery.jstree.typings.d.ts

4
ui-ngx/src/app/shared/components/nav-tree.component.ts

@ -149,9 +149,9 @@ export class NavTreeComponent implements OnInit {
this.treeElement = $('.tb-nav-tree-container', this.elementRef.nativeElement).jstree(config); this.treeElement = $('.tb-nav-tree-container', this.elementRef.nativeElement).jstree(config);
this.treeElement.on('select_node.jstree', (e: any, data) => { this.treeElement.on('changed.jstree', (e: any, data) => {
const node: NavTreeNode = data.instance.get_selected(true)[0]; const node: NavTreeNode = data.instance.get_selected(true)[0];
if (this.onNodeSelected) { if (this.onNodeSelected && data.action !== 'ready') {
this.ngZone.run(() => this.onNodeSelected(node, e as Event)); this.ngZone.run(() => this.onNodeSelected(node, e as Event));
} }
}); });

1
ui-ngx/src/typings/jquery.jstree.typings.d.ts

@ -26,6 +26,7 @@ interface JQuery {
} }
interface JSTreeEventData { interface JSTreeEventData {
action: string;
instance: JSTree; instance: JSTree;
} }

Loading…
Cancel
Save