Commit 558583b6 authored by Frank Bergmann's avatar Frank Bergmann

- Moved nodesInTree auxillary function to the shared class

parent 492d35df
...@@ -234,6 +234,26 @@ Ext.define('PO.view.gantt.AbstractGanttPanel', { ...@@ -234,6 +234,26 @@ Ext.define('PO.view.gantt.AbstractGanttPanel', {
return result; return result;
}, },
/**
* Calculate the number of nodes in an arbitrary tree model
*/
nodesInTree: function(node) {
var me = this;
var count = 1;
// if (me.debug) console.log('PO.view.gantt.GanttBarPanel.nodesInTree: Starting');
if (node.isExpanded() || node.isRoot()) {
var children = node.childNodes;
children.forEach(function(child) {
count = count + me.nodesInTree(child);
});
}
// if (me.debug) console.log('PO.view.gantt.GanttBarPanel.nodesInTree: Finished');
return count;
},
/** /**
* Draw all Gantt bars * Draw all Gantt bars
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment