Skip to content

Commit

Permalink
update demos
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeng committed Feb 22, 2023
1 parent 28f797a commit b48d6e5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions demo/isHybrid.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{ 'id': '7', 'name': 'Dan Dan', 'title': 'UE engineer' ,
'children': [
{ 'id': '8', 'name': 'Er Dan', 'title': 'engineer' },
{ 'id': '9', 'name': 'San Dan', 'title': 'engineer', 'isHybrid': true,
{ 'id': '9', 'name': 'San Dan', 'title': 'engineer',
'children': [
{ 'id': '10', 'name': 'Si Dan', 'title': 'intern' },
{ 'id': '11', 'name': 'Wu Dan', 'title': 'intern' }
Expand All @@ -61,7 +61,8 @@

$('#chart-container').orgchart({
'data' : datascource,
'nodeContent': 'title'
'nodeContent': 'title',
'verticalLevel': 5
});

});
Expand Down
5 changes: 3 additions & 2 deletions dist/js/jquery.orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,9 @@
if (isHidden && (opts.verticalLevel && (level + 1) >= opts.verticalLevel)) {
$nodesLayer.addClass('hidden');
}
if ((opts.verticalLevel && level + 1 === opts.verticalLevel) || data.isHybrid) {
$appendTo.append($nodesLayer.addClass('vertical'));
if (((opts.verticalLevel && level + 1 === opts.verticalLevel) || data.isHybrid)
&& !$appendTo.closest('.vertical').length) {
$appendTo.append($nodesLayer.addClass('vertical'));
} else {
$appendTo.append($nodesLayer);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/jquery.orgchart.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jquery.orgchart.min.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/js/jquery.orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,9 @@
if (isHidden && (opts.verticalLevel && (level + 1) >= opts.verticalLevel)) {
$nodesLayer.addClass('hidden');
}
if ((opts.verticalLevel && level + 1 === opts.verticalLevel) || data.isHybrid) {
$appendTo.append($nodesLayer.addClass('vertical'));
if (((opts.verticalLevel && level + 1 === opts.verticalLevel) || data.isHybrid)
&& !$appendTo.closest('.vertical').length) {
$appendTo.append($nodesLayer.addClass('vertical'));
} else {
$appendTo.append($nodesLayer);
}
Expand Down

0 comments on commit b48d6e5

Please sign in to comment.