Skip to content

Commit

Permalink
refactor the function buildJsonDS()
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeng committed Apr 14, 2016
1 parent 4dc8afe commit 0381696
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/js/jquery.orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
function buildJsonDS($li) {
var subObj = {
'name': $li.contents().eq(0).text().trim(),
'relationship': ($li.parent().parent().is('li') ? '1': '0') + ($li.siblings('li').length ? 1: 0) + ($li.children().length ? 1 : 0)
'relationship': ($li.parent().parent().is('li') ? '1': '0') + ($li.siblings('li').length ? 1: 0) + ($li.children('ul').length ? 1 : 0)
};
$li.children('ul').children().each(function() {
if (!subObj.children) { subObj.children = []; }
Expand Down
2 changes: 1 addition & 1 deletion jquery.orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
function buildJsonDS($li) {
var subObj = {
'name': $li.contents().eq(0).text().trim(),
'relationship': ($li.parent().parent().is('li') ? '1': '0') + ($li.siblings('li').length ? 1: 0) + ($li.children().length ? 1 : 0)
'relationship': ($li.parent().parent().is('li') ? '1': '0') + ($li.siblings('li').length ? 1: 0) + ($li.children('ul').length ? 1 : 0)
};
$li.children('ul').children().each(function() {
if (!subObj.children) { subObj.children = []; }
Expand Down

0 comments on commit 0381696

Please sign in to comment.