Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Guillaume DOTT | 3caab2ab00 |
|
@ -21,7 +21,7 @@
|
||||||
$this = $(this);
|
$this = $(this);
|
||||||
var $container = $("<div class='" + opts.chartClass + "'/>");
|
var $container = $("<div class='" + opts.chartClass + "'/>");
|
||||||
if($this.is("ul")) {
|
if($this.is("ul")) {
|
||||||
buildNodes($this, $container, opts);
|
buildNode($this.find("li:first"), $container, 0, opts);
|
||||||
}
|
}
|
||||||
else if($this.is("li")) {
|
else if($this.is("li")) {
|
||||||
buildNode($this, $container, 0, opts);
|
buildNode($this, $container, 0, opts);
|
||||||
|
@ -103,25 +103,6 @@
|
||||||
ignoreSpace: false
|
ignoreSpace: false
|
||||||
};
|
};
|
||||||
|
|
||||||
function buildNodes($list, $appendTo, opts) {
|
|
||||||
var $table = $("<table cellpadding='0' cellspacing='0' border='0'/>");
|
|
||||||
var $tbody = $("<tbody/>");
|
|
||||||
|
|
||||||
// Construct the node container(s)
|
|
||||||
var $nodeRow = $("<tr/>");
|
|
||||||
$list.children("li").each(function(i, elem) {
|
|
||||||
var $td = $("<td class='node-container'/>");
|
|
||||||
$td.attr("colspan", 2);
|
|
||||||
|
|
||||||
buildNode($(elem), $td, 0, opts);
|
|
||||||
$nodeRow.append($td);
|
|
||||||
});
|
|
||||||
|
|
||||||
$tbody.append($nodeRow);
|
|
||||||
$table.append($tbody);
|
|
||||||
$appendTo.append($table);
|
|
||||||
}
|
|
||||||
|
|
||||||
var nodeCount = 0;
|
var nodeCount = 0;
|
||||||
// Method that recursively builds the tree
|
// Method that recursively builds the tree
|
||||||
function buildNode($node, $appendTo, level, opts) {
|
function buildNode($node, $appendTo, level, opts) {
|
||||||
|
|
Loading…
Reference in New Issue