brotherton-erpnext/erpnext/hr/page/organizational_chart/organizational_chart.js
Rucha Mahabal 249621af1b refactor: add options to chart
- method to return the node data

- wrapper for showing the hierarchy
2021-08-10 17:47:06 +05:30

21 lines
651 B
JavaScript

frappe.pages['organizational-chart'].on_page_load = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Organizational Chart'),
single_column: true
});
$(wrapper).bind('show', () => {
frappe.require('/assets/js/hierarchy-chart.min.js', () => {
let organizational_chart = undefined;
let method = 'erpnext.hr.page.organizational_chart.organizational_chart.get_children';
if (frappe.is_mobile()) {
organizational_chart = new erpnext.HierarchyChartMobile(wrapper, method);
} else {
organizational_chart = new erpnext.HierarchyChart(wrapper, method);
}
organizational_chart.show();
});
});
};