diff --git a/bower.json b/bower.json index 1b765c49..cc48d474 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "orgchart", - "version": "2.0.15", + "version": "2.1.0", "homepage": "https://github.com/dabeng/OrgChart", "authors": [ "dabeng " diff --git a/demo/js/jquery.orgchart.js b/demo/js/jquery.orgchart.js index 087a5a10..5748f99d 100644 --- a/demo/js/jquery.orgchart.js +++ b/demo/js/jquery.orgchart.js @@ -24,7 +24,7 @@ 'nodeTitle': 'name', 'nodeId': 'id', 'toggleSiblingsResp': false, - 'depth': 999, + 'visibleLevel': 999, 'chartClass': '', 'exportButton': false, 'exportFilename': 'OrgChart', @@ -66,7 +66,7 @@ if (data instanceof $) { // ul datasource this.buildHierarchy($chart, this.buildJsonDS(data.children()), 0, this.options); } else { // local json datasource - this.buildHierarchy($chart, this.options.ajaxURL ? data : this.attachRel(data, '00'), 0, this.options); + this.buildHierarchy($chart, this.options.ajaxURL ? data : this.attachRel(data, '00')); } } else { $chart.append(''); @@ -509,6 +509,7 @@ }, // hideChildrenEnd: function (event) { + var $node = event.data.node; event.data.animatedNodes.removeClass('sliding'); if (event.data.isVerticalDesc) { event.data.lowerLevel.addClass('hidden'); @@ -516,8 +517,8 @@ event.data.animatedNodes.closest('.nodes').prevAll('.lines').removeAttr('style').addBack().addClass('hidden'); event.data.lowerLevel.last().find('.verticalNodes').addClass('hidden'); } - if (this.isInAction(event.data.node)) { - this.switchVerticalArrow(event.data.node.children('.bottomEdge')); + if (this.isInAction($node)) { + this.switchVerticalArrow($node.children('.bottomEdge')); } }, // recursively hide the descendant nodes of the specified node @@ -672,7 +673,7 @@ }, // switchHorizontalArrow: function ($node) { - var opts = $node.closest('.orgchart').data('options'); + var opts = this.options; if (opts.toggleSiblingsResp && (typeof opts.ajaxURL === 'undefined' || $node.closest('.nodes').data('siblingsLoaded'))) { var $prevSib = $node.closest('table').parent().prev(); if ($prevSib.length) { @@ -740,16 +741,14 @@ if (that.$chart.data('inAjax')) { if (rel === 'parent') { if (!$.isEmptyObject(data)) { - that.addParent($edge.parent(), data, opts); + that.addParent($edge.parent(), data); } } else if (rel === 'children') { if (data.children.length) { - that.addChildren($edge.parent(), data, $.extend({}, opts, { depth: 0 })); + that.addChildren($edge.parent(), data[rel]); } } else { - if (data.siblings || data.children) { - that.addSiblings($edge.parent(), data, opts); - } + that.addSiblings($edge.parent(), data.siblings ? data.siblings : data); } } }) @@ -1117,29 +1116,40 @@ // Dispatch the simulated event to the target element event.target.dispatchEvent(simulatedEvent); }, + // + bindDragDrop: function ($node) { + $node.on('dragstart', this.dragstartHandler.bind(this)) + .on('dragover', this.dragoverHandler.bind(this)) + .on('dragend', this.dragendHandler.bind(this)) + .on('drop', this.dropHandler.bind(this)) + .on('touchstart', this.touchstartHandler.bind(this)) + .on('touchmove', this.touchmoveHandler.bind(this)) + .on('touchend', this.touchendHandler.bind(this)); + }, // create node - createNode: function (nodeData, level, opts) { + createNode: function (data) { var that = this; - if (nodeData.children) { - $.each(nodeData.children, function (index, child) { - child.parentId = nodeData.id; + var opts = this.options; + var level = data.level; + if (data.children) { + $.each(data.children, function (index, child) { + child.parentId = data.id; }); } - var dtd = $.Deferred(); // construct the content of node - var $nodeDiv = $('') - .addClass('node ' + (nodeData.className || '') + (level >= opts.depth ? ' slide-up' : '')); + var $nodeDiv = $('') + .addClass('node ' + (data.className || '') + (level > opts.visibleLevel ? ' slide-up' : '')); if (opts.nodeTemplate) { - $nodeDiv.append(opts.nodeTemplate(nodeData)); + $nodeDiv.append(opts.nodeTemplate(data)); } else { - $nodeDiv.append('
' + nodeData[opts.nodeTitle] + '
') - .append(typeof opts.nodeContent !== 'undefined' ? '
' + (nodeData[opts.nodeContent] || '') + '
' : ''); + $nodeDiv.append('
' + data[opts.nodeTitle] + '
') + .append(typeof opts.nodeContent !== 'undefined' ? '
' + (data[opts.nodeContent] || '') + '
' : ''); } // append 4 direction arrows or expand/collapse buttons - var flags = nodeData.relationship || ''; - if (opts.verticalDepth && (level + 2) > opts.verticalDepth) { - if ((level + 1) >= opts.verticalDepth && Number(flags.substr(2,1))) { - var icon = level + 1 >= opts.depth ? 'plus' : 'minus'; + var flags = data.relationship || ''; + if (opts.verticalLevel && level >= opts.verticalLevel) { + if ((level + 1) > opts.verticalLevel && Number(flags.substr(2,1))) { + var icon = level + 1 > opts.visibleLevel ? 'plus' : 'minus'; $nodeDiv.append(''); } } else { @@ -1158,154 +1168,124 @@ $nodeDiv.on('mouseenter mouseleave', this.nodeEnterLeaveHandler.bind(this)); $nodeDiv.on('click', this.nodeClickHandler.bind(this)); - $nodeDiv.on('click', '.topEdge', { 'nodeData': nodeData }, this.topEdgeClickHandler.bind(this)); - $nodeDiv.on('click', '.bottomEdge', { 'nodeData': nodeData }, this.bottomEdgeClickHandler.bind(this)); - $nodeDiv.on('click', '.leftEdge, .rightEdge', { 'nodeData': nodeData }, this.hEdgeClickHandler.bind(this)); + $nodeDiv.on('click', '.topEdge', { 'nodeData': data }, this.topEdgeClickHandler.bind(this)); + $nodeDiv.on('click', '.bottomEdge', { 'nodeData': data }, this.bottomEdgeClickHandler.bind(this)); + $nodeDiv.on('click', '.leftEdge, .rightEdge', { 'nodeData': data }, this.hEdgeClickHandler.bind(this)); $nodeDiv.on('click', '.toggleBtn', this.toggleVNodes.bind(this)); if (opts.draggable) { - $nodeDiv.on('dragstart', this.dragstartHandler.bind(this)) - .on('dragover', this.dragoverHandler.bind(this)) - .on('dragend', this.dragendHandler.bind(this)) - .on('drop', this.dropHandler.bind(this)) - .on('touchstart', this.touchstartHandler.bind(this)) - .on('touchmove', this.touchmoveHandler.bind(this)) - .on('touchend', this.touchendHandler.bind(this)); + this.bindDragDrop($nodeDiv); this.touchHandled = false; this.touchMoved = false; this.touchTargetNode = null; } // allow user to append dom modification after finishing node create of orgchart if (opts.createNode) { - opts.createNode($nodeDiv, nodeData); + opts.createNode($nodeDiv, data); } - dtd.resolve($nodeDiv); - return dtd.promise(); + + return $nodeDiv; }, // recursively build the tree - buildHierarchy: function ($appendTo, nodeData, level, opts, callback) { + buildHierarchy: function ($appendTo, data) { var that = this; - var $nodeWrapper; + var opts = this.options; + var level = 0; + if (data.level) { + level = data.level; + } else { + level = data.level = $appendTo.parentsUntil('.orgchart', '.nodes').length + 1; + } // Construct the node - var $childNodes = nodeData.children; - var hasChildren = $childNodes ? $childNodes.length : false; - var isVerticalNode = (opts.verticalDepth && (level + 1) >= opts.verticalDepth) ? true : false; - if (Object.keys(nodeData).length > 1) { // if nodeData has nested structure - $nodeWrapper = isVerticalNode ? $appendTo : $(''); - if (!isVerticalNode) { - $appendTo.append($nodeWrapper); + var childrenData = data.children; + var hasChildren = childrenData ? childrenData.length : false; + var $nodeWrapper; + if (Object.keys(data).length > 2) { + var $nodeDiv = this.createNode(data); + if (opts.verticalLevel && level >= opts.verticalLevel) { + $appendTo.append($nodeDiv); + }else { + $nodeWrapper = $('
'); + $appendTo.append($nodeWrapper.append($('').append($('').append($nodeDiv)))); } - $.when(this.createNode(nodeData, level, opts)) - .done(function($nodeDiv) { - if (isVerticalNode) { - $nodeWrapper.append($nodeDiv); - }else { - $nodeWrapper.append($('').append($('').append($nodeDiv))); - } - if (callback) { - callback(); - } - }) - .fail(function() { - console.log('Failed to creat node') - }); } - // Construct the inferior nodes and connectiong lines + // Construct the lower level(two "connectiong lines" rows and "inferior nodes" row) if (hasChildren) { - if (Object.keys(nodeData).length === 1) { // if nodeData is just an array - $nodeWrapper = $appendTo; - } - var isHidden = (level + 1 >= opts.depth || nodeData.collapsed) ? ' hidden' : ''; - var isVerticalLayer = (opts.verticalDepth && (level + 2) >= opts.verticalDepth) ? true : false; - - // draw the line close to parent node - if (!isVerticalLayer) { - $nodeWrapper.append(''); - } - // draw the lines close to children nodes - var lineLayer = ''; - for (var i=1; i<$childNodes.length; i++) { - lineLayer += ''; - } - lineLayer += ''; - var $nodeLayer; + var isHidden = (level + 1 > opts.visibleLevel || data.collapsed) ? ' hidden' : ''; + var isVerticalLayer = (opts.verticalLevel && (level + 1) >= opts.verticalLevel) ? true : false; + var $nodesLayer; if (isVerticalLayer) { - $nodeLayer = $('
    '); - if (isHidden && opts.depth + 1 !== opts.verticalDepth) { - $nodeLayer.addClass(isHidden); + $nodesLayer = $('
      '); + if (isHidden && level + 1 > opts.verticalLevel) { + $nodesLayer.addClass(isHidden); } - if (level + 2 === opts.verticalDepth) { - $nodeWrapper.append('
') - .find('.verticalNodes').children().append($nodeLayer); + if (level + 1 === opts.verticalLevel) { + $appendTo.children('table').append('') + .find('.verticalNodes').children().append($nodesLayer); } else { - $nodeWrapper.append($nodeLayer); + $appendTo.append($nodesLayer); } } else { - $nodeLayer = $(''); - $nodeWrapper.append(lineLayer).append($nodeLayer); + var $upperLines = $(''); + var lowerLines = ''; + for (var i=1; i'); + if (Object.keys(data).length === 2) { + $appendTo.append($upperLines).append(lowerLines).append($nodesLayer); + } else { + $nodeWrapper.append($upperLines).append(lowerLines).append($nodesLayer); + } } // recurse through children nodes - $.each($childNodes, function() { + $.each(childrenData, function () { var $nodeCell = isVerticalLayer ? $('
  • ') : $('
  • '); - $nodeLayer.append($nodeCell); - that.buildHierarchy($nodeCell, this, level + 1, opts, callback); + $nodesLayer.append($nodeCell); + this.level = level + 1; + that.buildHierarchy($nodeCell, this); }); } }, // build the child nodes of specific node - buildChildNode: function ($appendTo, nodeData, opts, callback) { - var opts = opts || $appendTo.closest('.orgchart').data('options'); - var data = nodeData.children || nodeData.siblings; + buildChildNode: function ($appendTo, data) { $appendTo.find('td:first').attr('colspan', data.length * 2); - this.buildHierarchy($appendTo, { 'children': data }, 0, opts, callback); + this.buildHierarchy($appendTo, { 'children': data }); }, // exposed method - addChildren: function ($node, data, opts) { - var that = this; - var opts = opts || $node.closest('.orgchart').data('options'); - var count = 0; - this.buildChildNode($node.closest('table'), data, opts, function() { - if (++count === data.children.length) { - if (!$node.children('.bottomEdge').length) { - $node.append(''); - } - if (!$node.find('.symbol').length) { - $node.children('.title').prepend(''); - } - that.showChildren($node); - } - }); + addChildren: function ($node, data) { + this.buildChildNode($node.closest('table'), data); + if (!$node.children('.bottomEdge').length) { + $node.append(''); + } + if (!$node.find('.symbol').length) { + $node.children('.title').prepend(''); + } + if (this.isInAction($node)) { + this.switchVerticalArrow($node.children('.bottomEdge')); + } }, // build the parent node of specific node - buildParentNode: function ($currentRoot, nodeData, opts, callback) { - var that = this; - var $table = $(''); - nodeData.relationship = nodeData.relationship || '001'; - $.when(this.createNode(nodeData, 0, opts || $currentRoot.closest('.orgchart').data('options'))) - .done(function($nodeDiv) { - $table.append($('').append($(''); - var linesRow = ''; - $table.append('' + linesRow + ''); - var $chart = that.$chart; - $chart.prepend($table) - .children('table:first').append('') - .children('tr:last').children().append($chart.children('table').last()); - callback(); - }) - .fail(function() { - console.log('Failed to create parent node'); - }); + buildParentNode: function ($currentRoot, data) { + data.relationship = data.relationship || '001'; + var $table = $('
    ') + .append($('').append($('') + .append(''); + this.$chart.prepend($table) + .children('table:first').append('') + .children('tr:last').children().append(this.$chart.children('table').last()); }, // exposed method - addParent: function ($currentRoot, data, opts) { - var that = this; - this.buildParentNode($currentRoot, data, opts, function() { - if (!$currentRoot.children('.topEdge').length) { - $currentRoot.children('.title').after(''); - } - that.showParent($currentRoot); - }); + addParent: function ($currentRoot, data) { + this.buildParentNode($currentRoot, data); + if (!$currentRoot.children('.topEdge').length) { + $currentRoot.children('.title').after(''); + } + if (this.isInAction($currentRoot)) { + this.switchVerticalArrow($currentRoot.children('.topEdge')); + } }, // subsequent processing of build sibling nodes complementLine: function ($oneSibling, siblingCount, existingSibligCount) { @@ -1317,10 +1297,8 @@ .end().next().children(':first').after(lines); }, // build the sibling nodes of specific node - buildSiblingNode: function ($nodeChart, nodeData, opts, callback) { - var that = this; - var opts = opts || $nodeChart.closest('.orgchart').data('options'); - var newSiblingCount = nodeData.siblings ? nodeData.siblings.length : nodeData.children.length; + buildSiblingNode: function ($nodeChart, data) { + var newSiblingCount = $.isArray(data) ? data.length : data.children.length; var existingSibligCount = $nodeChart.parent().is('td') ? $nodeChart.closest('tr').children().length : 1; var siblingCount = existingSibligCount + newSiblingCount; var insertPostion = (siblingCount > 1) ? Math.floor(siblingCount/2 - 1) : 0; @@ -1328,48 +1306,30 @@ if ($nodeChart.parent().is('td')) { var $parent = $nodeChart.closest('tr').prevAll('tr:last'); $nodeChart.closest('tr').prevAll('tr:lt(2)').remove(); - var childCount = 0; - this.buildChildNode($nodeChart.parent().closest('table'), nodeData, opts, function() { - if (++childCount === newSiblingCount) { - var $siblingTds = $nodeChart.parent().closest('table').children('tr:last').children('td'); - if (existingSibligCount > 1) { - that.complementLine($siblingTds.eq(0).before($nodeChart.closest('td').siblings().addBack().unwrap()), siblingCount, existingSibligCount); - $siblingTds.addClass('hidden').find('.node').addClass('slide-left'); - } else { - that.complementLine($siblingTds.eq(insertPostion).after($nodeChart.closest('td').unwrap()), siblingCount, 1); - $siblingTds.not(':eq(' + insertPostion + 1 + ')').addClass('hidden') - .slice(0, insertPostion).find('.node').addClass('slide-right') - .end().end().slice(insertPostion).find('.node').addClass('slide-left'); - } - callback(); - } - }); + this.buildChildNode($nodeChart.parent().closest('table'), data); + var $siblingTds = $nodeChart.parent().closest('table').children('tr:last').children('td'); + if (existingSibligCount > 1) { + this.complementLine($siblingTds.eq(0).before($nodeChart.closest('td').siblings().addBack().unwrap()), siblingCount, existingSibligCount); + } else { + this.complementLine($siblingTds.eq(insertPostion).after($nodeChart.closest('td').unwrap()), siblingCount, 1); + } } else { // build the sibling nodes and parent node for the specific ndoe - var nodeCount = 0; - this.buildHierarchy($nodeChart.closest('.orgchart'), nodeData, 0, opts, function() { - if (++nodeCount === siblingCount) { - that.complementLine($nodeChart.next().children('tr:last') - .children().eq(insertPostion).after($('
    ').append(this.createNode(data)))) + .append('
    ') - .append($nodeChart)), siblingCount, 1); - $nodeChart.closest('tr').siblings().eq(0).addClass('hidden').find('.node').addClass('slide-down'); - $nodeChart.parent().siblings().addClass('hidden') - .slice(0, insertPostion).find('.node').addClass('slide-right') - .end().end().slice(insertPostion).find('.node').addClass('slide-left'); - callback(); - } - }); + this.buildHierarchy($nodeChart.closest('.orgchart'), data); + this.complementLine($nodeChart.next().children('tr:last').children().eq(insertPostion).after($('').append($nodeChart)), + siblingCount, 1); } }, // - addSiblings: function ($node, data, opts) { - var that = this; - this.buildSiblingNode($node.closest('table'), data, opts, function() { - $node.closest('.nodes').data('siblingsLoaded', true); - if (!$node.children('.leftEdge').length) { - $node.children('.topEdge').after(''); - } - that.showSiblings($node); - }); + addSiblings: function ($node, data) { + this.buildSiblingNode($node.closest('table'), data); + $node.closest('.nodes').data('siblingsLoaded', true); + if (!$node.children('.leftEdge').length) { + $node.children('.topEdge').after(''); + } + if (this.isInAction($node)) { + this.switchHorizontalArrow($node); + $node.children('.topEdge').removeClass('fa-chevron-up').addClass('fa-chevron-down'); + } }, // removeNodes: function ($node) { diff --git a/dist/js/jquery.orgchart.js b/dist/js/jquery.orgchart.js index 087a5a10..5748f99d 100644 --- a/dist/js/jquery.orgchart.js +++ b/dist/js/jquery.orgchart.js @@ -24,7 +24,7 @@ 'nodeTitle': 'name', 'nodeId': 'id', 'toggleSiblingsResp': false, - 'depth': 999, + 'visibleLevel': 999, 'chartClass': '', 'exportButton': false, 'exportFilename': 'OrgChart', @@ -66,7 +66,7 @@ if (data instanceof $) { // ul datasource this.buildHierarchy($chart, this.buildJsonDS(data.children()), 0, this.options); } else { // local json datasource - this.buildHierarchy($chart, this.options.ajaxURL ? data : this.attachRel(data, '00'), 0, this.options); + this.buildHierarchy($chart, this.options.ajaxURL ? data : this.attachRel(data, '00')); } } else { $chart.append(''); @@ -509,6 +509,7 @@ }, // hideChildrenEnd: function (event) { + var $node = event.data.node; event.data.animatedNodes.removeClass('sliding'); if (event.data.isVerticalDesc) { event.data.lowerLevel.addClass('hidden'); @@ -516,8 +517,8 @@ event.data.animatedNodes.closest('.nodes').prevAll('.lines').removeAttr('style').addBack().addClass('hidden'); event.data.lowerLevel.last().find('.verticalNodes').addClass('hidden'); } - if (this.isInAction(event.data.node)) { - this.switchVerticalArrow(event.data.node.children('.bottomEdge')); + if (this.isInAction($node)) { + this.switchVerticalArrow($node.children('.bottomEdge')); } }, // recursively hide the descendant nodes of the specified node @@ -672,7 +673,7 @@ }, // switchHorizontalArrow: function ($node) { - var opts = $node.closest('.orgchart').data('options'); + var opts = this.options; if (opts.toggleSiblingsResp && (typeof opts.ajaxURL === 'undefined' || $node.closest('.nodes').data('siblingsLoaded'))) { var $prevSib = $node.closest('table').parent().prev(); if ($prevSib.length) { @@ -740,16 +741,14 @@ if (that.$chart.data('inAjax')) { if (rel === 'parent') { if (!$.isEmptyObject(data)) { - that.addParent($edge.parent(), data, opts); + that.addParent($edge.parent(), data); } } else if (rel === 'children') { if (data.children.length) { - that.addChildren($edge.parent(), data, $.extend({}, opts, { depth: 0 })); + that.addChildren($edge.parent(), data[rel]); } } else { - if (data.siblings || data.children) { - that.addSiblings($edge.parent(), data, opts); - } + that.addSiblings($edge.parent(), data.siblings ? data.siblings : data); } } }) @@ -1117,29 +1116,40 @@ // Dispatch the simulated event to the target element event.target.dispatchEvent(simulatedEvent); }, + // + bindDragDrop: function ($node) { + $node.on('dragstart', this.dragstartHandler.bind(this)) + .on('dragover', this.dragoverHandler.bind(this)) + .on('dragend', this.dragendHandler.bind(this)) + .on('drop', this.dropHandler.bind(this)) + .on('touchstart', this.touchstartHandler.bind(this)) + .on('touchmove', this.touchmoveHandler.bind(this)) + .on('touchend', this.touchendHandler.bind(this)); + }, // create node - createNode: function (nodeData, level, opts) { + createNode: function (data) { var that = this; - if (nodeData.children) { - $.each(nodeData.children, function (index, child) { - child.parentId = nodeData.id; + var opts = this.options; + var level = data.level; + if (data.children) { + $.each(data.children, function (index, child) { + child.parentId = data.id; }); } - var dtd = $.Deferred(); // construct the content of node - var $nodeDiv = $('') - .addClass('node ' + (nodeData.className || '') + (level >= opts.depth ? ' slide-up' : '')); + var $nodeDiv = $('') + .addClass('node ' + (data.className || '') + (level > opts.visibleLevel ? ' slide-up' : '')); if (opts.nodeTemplate) { - $nodeDiv.append(opts.nodeTemplate(nodeData)); + $nodeDiv.append(opts.nodeTemplate(data)); } else { - $nodeDiv.append('
    ' + nodeData[opts.nodeTitle] + '
    ') - .append(typeof opts.nodeContent !== 'undefined' ? '
    ' + (nodeData[opts.nodeContent] || '') + '
    ' : ''); + $nodeDiv.append('
    ' + data[opts.nodeTitle] + '
    ') + .append(typeof opts.nodeContent !== 'undefined' ? '
    ' + (data[opts.nodeContent] || '') + '
    ' : ''); } // append 4 direction arrows or expand/collapse buttons - var flags = nodeData.relationship || ''; - if (opts.verticalDepth && (level + 2) > opts.verticalDepth) { - if ((level + 1) >= opts.verticalDepth && Number(flags.substr(2,1))) { - var icon = level + 1 >= opts.depth ? 'plus' : 'minus'; + var flags = data.relationship || ''; + if (opts.verticalLevel && level >= opts.verticalLevel) { + if ((level + 1) > opts.verticalLevel && Number(flags.substr(2,1))) { + var icon = level + 1 > opts.visibleLevel ? 'plus' : 'minus'; $nodeDiv.append(''); } } else { @@ -1158,154 +1168,124 @@ $nodeDiv.on('mouseenter mouseleave', this.nodeEnterLeaveHandler.bind(this)); $nodeDiv.on('click', this.nodeClickHandler.bind(this)); - $nodeDiv.on('click', '.topEdge', { 'nodeData': nodeData }, this.topEdgeClickHandler.bind(this)); - $nodeDiv.on('click', '.bottomEdge', { 'nodeData': nodeData }, this.bottomEdgeClickHandler.bind(this)); - $nodeDiv.on('click', '.leftEdge, .rightEdge', { 'nodeData': nodeData }, this.hEdgeClickHandler.bind(this)); + $nodeDiv.on('click', '.topEdge', { 'nodeData': data }, this.topEdgeClickHandler.bind(this)); + $nodeDiv.on('click', '.bottomEdge', { 'nodeData': data }, this.bottomEdgeClickHandler.bind(this)); + $nodeDiv.on('click', '.leftEdge, .rightEdge', { 'nodeData': data }, this.hEdgeClickHandler.bind(this)); $nodeDiv.on('click', '.toggleBtn', this.toggleVNodes.bind(this)); if (opts.draggable) { - $nodeDiv.on('dragstart', this.dragstartHandler.bind(this)) - .on('dragover', this.dragoverHandler.bind(this)) - .on('dragend', this.dragendHandler.bind(this)) - .on('drop', this.dropHandler.bind(this)) - .on('touchstart', this.touchstartHandler.bind(this)) - .on('touchmove', this.touchmoveHandler.bind(this)) - .on('touchend', this.touchendHandler.bind(this)); + this.bindDragDrop($nodeDiv); this.touchHandled = false; this.touchMoved = false; this.touchTargetNode = null; } // allow user to append dom modification after finishing node create of orgchart if (opts.createNode) { - opts.createNode($nodeDiv, nodeData); + opts.createNode($nodeDiv, data); } - dtd.resolve($nodeDiv); - return dtd.promise(); + + return $nodeDiv; }, // recursively build the tree - buildHierarchy: function ($appendTo, nodeData, level, opts, callback) { + buildHierarchy: function ($appendTo, data) { var that = this; - var $nodeWrapper; + var opts = this.options; + var level = 0; + if (data.level) { + level = data.level; + } else { + level = data.level = $appendTo.parentsUntil('.orgchart', '.nodes').length + 1; + } // Construct the node - var $childNodes = nodeData.children; - var hasChildren = $childNodes ? $childNodes.length : false; - var isVerticalNode = (opts.verticalDepth && (level + 1) >= opts.verticalDepth) ? true : false; - if (Object.keys(nodeData).length > 1) { // if nodeData has nested structure - $nodeWrapper = isVerticalNode ? $appendTo : $(''); - if (!isVerticalNode) { - $appendTo.append($nodeWrapper); + var childrenData = data.children; + var hasChildren = childrenData ? childrenData.length : false; + var $nodeWrapper; + if (Object.keys(data).length > 2) { + var $nodeDiv = this.createNode(data); + if (opts.verticalLevel && level >= opts.verticalLevel) { + $appendTo.append($nodeDiv); + }else { + $nodeWrapper = $('
    '); + $appendTo.append($nodeWrapper.append($('').append($('').append($nodeDiv)))); } - $.when(this.createNode(nodeData, level, opts)) - .done(function($nodeDiv) { - if (isVerticalNode) { - $nodeWrapper.append($nodeDiv); - }else { - $nodeWrapper.append($('').append($('').append($nodeDiv))); - } - if (callback) { - callback(); - } - }) - .fail(function() { - console.log('Failed to creat node') - }); } - // Construct the inferior nodes and connectiong lines + // Construct the lower level(two "connectiong lines" rows and "inferior nodes" row) if (hasChildren) { - if (Object.keys(nodeData).length === 1) { // if nodeData is just an array - $nodeWrapper = $appendTo; - } - var isHidden = (level + 1 >= opts.depth || nodeData.collapsed) ? ' hidden' : ''; - var isVerticalLayer = (opts.verticalDepth && (level + 2) >= opts.verticalDepth) ? true : false; - - // draw the line close to parent node - if (!isVerticalLayer) { - $nodeWrapper.append(''); - } - // draw the lines close to children nodes - var lineLayer = ''; - for (var i=1; i<$childNodes.length; i++) { - lineLayer += ''; - } - lineLayer += ''; - var $nodeLayer; + var isHidden = (level + 1 > opts.visibleLevel || data.collapsed) ? ' hidden' : ''; + var isVerticalLayer = (opts.verticalLevel && (level + 1) >= opts.verticalLevel) ? true : false; + var $nodesLayer; if (isVerticalLayer) { - $nodeLayer = $('
      '); - if (isHidden && opts.depth + 1 !== opts.verticalDepth) { - $nodeLayer.addClass(isHidden); + $nodesLayer = $('
        '); + if (isHidden && level + 1 > opts.verticalLevel) { + $nodesLayer.addClass(isHidden); } - if (level + 2 === opts.verticalDepth) { - $nodeWrapper.append('
    ') - .find('.verticalNodes').children().append($nodeLayer); + if (level + 1 === opts.verticalLevel) { + $appendTo.children('table').append('') + .find('.verticalNodes').children().append($nodesLayer); } else { - $nodeWrapper.append($nodeLayer); + $appendTo.append($nodesLayer); } } else { - $nodeLayer = $(''); - $nodeWrapper.append(lineLayer).append($nodeLayer); + var $upperLines = $(''); + var lowerLines = ''; + for (var i=1; i'); + if (Object.keys(data).length === 2) { + $appendTo.append($upperLines).append(lowerLines).append($nodesLayer); + } else { + $nodeWrapper.append($upperLines).append(lowerLines).append($nodesLayer); + } } // recurse through children nodes - $.each($childNodes, function() { + $.each(childrenData, function () { var $nodeCell = isVerticalLayer ? $('
  • ') : $('
  • '); - $nodeLayer.append($nodeCell); - that.buildHierarchy($nodeCell, this, level + 1, opts, callback); + $nodesLayer.append($nodeCell); + this.level = level + 1; + that.buildHierarchy($nodeCell, this); }); } }, // build the child nodes of specific node - buildChildNode: function ($appendTo, nodeData, opts, callback) { - var opts = opts || $appendTo.closest('.orgchart').data('options'); - var data = nodeData.children || nodeData.siblings; + buildChildNode: function ($appendTo, data) { $appendTo.find('td:first').attr('colspan', data.length * 2); - this.buildHierarchy($appendTo, { 'children': data }, 0, opts, callback); + this.buildHierarchy($appendTo, { 'children': data }); }, // exposed method - addChildren: function ($node, data, opts) { - var that = this; - var opts = opts || $node.closest('.orgchart').data('options'); - var count = 0; - this.buildChildNode($node.closest('table'), data, opts, function() { - if (++count === data.children.length) { - if (!$node.children('.bottomEdge').length) { - $node.append(''); - } - if (!$node.find('.symbol').length) { - $node.children('.title').prepend(''); - } - that.showChildren($node); - } - }); + addChildren: function ($node, data) { + this.buildChildNode($node.closest('table'), data); + if (!$node.children('.bottomEdge').length) { + $node.append(''); + } + if (!$node.find('.symbol').length) { + $node.children('.title').prepend(''); + } + if (this.isInAction($node)) { + this.switchVerticalArrow($node.children('.bottomEdge')); + } }, // build the parent node of specific node - buildParentNode: function ($currentRoot, nodeData, opts, callback) { - var that = this; - var $table = $(''); - nodeData.relationship = nodeData.relationship || '001'; - $.when(this.createNode(nodeData, 0, opts || $currentRoot.closest('.orgchart').data('options'))) - .done(function($nodeDiv) { - $table.append($('').append($(''); - var linesRow = ''; - $table.append('' + linesRow + ''); - var $chart = that.$chart; - $chart.prepend($table) - .children('table:first').append('') - .children('tr:last').children().append($chart.children('table').last()); - callback(); - }) - .fail(function() { - console.log('Failed to create parent node'); - }); + buildParentNode: function ($currentRoot, data) { + data.relationship = data.relationship || '001'; + var $table = $('
    ') + .append($('').append($('') + .append(''); + this.$chart.prepend($table) + .children('table:first').append('') + .children('tr:last').children().append(this.$chart.children('table').last()); }, // exposed method - addParent: function ($currentRoot, data, opts) { - var that = this; - this.buildParentNode($currentRoot, data, opts, function() { - if (!$currentRoot.children('.topEdge').length) { - $currentRoot.children('.title').after(''); - } - that.showParent($currentRoot); - }); + addParent: function ($currentRoot, data) { + this.buildParentNode($currentRoot, data); + if (!$currentRoot.children('.topEdge').length) { + $currentRoot.children('.title').after(''); + } + if (this.isInAction($currentRoot)) { + this.switchVerticalArrow($currentRoot.children('.topEdge')); + } }, // subsequent processing of build sibling nodes complementLine: function ($oneSibling, siblingCount, existingSibligCount) { @@ -1317,10 +1297,8 @@ .end().next().children(':first').after(lines); }, // build the sibling nodes of specific node - buildSiblingNode: function ($nodeChart, nodeData, opts, callback) { - var that = this; - var opts = opts || $nodeChart.closest('.orgchart').data('options'); - var newSiblingCount = nodeData.siblings ? nodeData.siblings.length : nodeData.children.length; + buildSiblingNode: function ($nodeChart, data) { + var newSiblingCount = $.isArray(data) ? data.length : data.children.length; var existingSibligCount = $nodeChart.parent().is('td') ? $nodeChart.closest('tr').children().length : 1; var siblingCount = existingSibligCount + newSiblingCount; var insertPostion = (siblingCount > 1) ? Math.floor(siblingCount/2 - 1) : 0; @@ -1328,48 +1306,30 @@ if ($nodeChart.parent().is('td')) { var $parent = $nodeChart.closest('tr').prevAll('tr:last'); $nodeChart.closest('tr').prevAll('tr:lt(2)').remove(); - var childCount = 0; - this.buildChildNode($nodeChart.parent().closest('table'), nodeData, opts, function() { - if (++childCount === newSiblingCount) { - var $siblingTds = $nodeChart.parent().closest('table').children('tr:last').children('td'); - if (existingSibligCount > 1) { - that.complementLine($siblingTds.eq(0).before($nodeChart.closest('td').siblings().addBack().unwrap()), siblingCount, existingSibligCount); - $siblingTds.addClass('hidden').find('.node').addClass('slide-left'); - } else { - that.complementLine($siblingTds.eq(insertPostion).after($nodeChart.closest('td').unwrap()), siblingCount, 1); - $siblingTds.not(':eq(' + insertPostion + 1 + ')').addClass('hidden') - .slice(0, insertPostion).find('.node').addClass('slide-right') - .end().end().slice(insertPostion).find('.node').addClass('slide-left'); - } - callback(); - } - }); + this.buildChildNode($nodeChart.parent().closest('table'), data); + var $siblingTds = $nodeChart.parent().closest('table').children('tr:last').children('td'); + if (existingSibligCount > 1) { + this.complementLine($siblingTds.eq(0).before($nodeChart.closest('td').siblings().addBack().unwrap()), siblingCount, existingSibligCount); + } else { + this.complementLine($siblingTds.eq(insertPostion).after($nodeChart.closest('td').unwrap()), siblingCount, 1); + } } else { // build the sibling nodes and parent node for the specific ndoe - var nodeCount = 0; - this.buildHierarchy($nodeChart.closest('.orgchart'), nodeData, 0, opts, function() { - if (++nodeCount === siblingCount) { - that.complementLine($nodeChart.next().children('tr:last') - .children().eq(insertPostion).after($('').end().next().append(n.closest("table").parent());var r=n.closest("table").parent().siblings().find(".node:first");1===r.length&&r.append(d)}else i.append('').parent().attr("colspan",2).parent().after('').siblings(":last").append(n.find(".horizontalEdge").remove().end().closest("table").parent());var l=parseInt(s.attr("colspan"));if(l>2){s.attr("colspan",l-2).parent().next().children().attr("colspan",l-2).end().next().children().slice(1,3).remove();var h=s.parent().siblings(".nodes").children().find(".node:first");1===h.length&&h.find(".horizontalEdge").remove()}else s.removeAttr("colspan").find(".bottomEdge").remove().end().end().siblings().remove()}},touchstartHandler:function(e){console.log("orgChart: touchstart 1: touchHandled="+this.touchHandled+", touchMoved="+this.touchMoved+", target="+e.target.innerText),this.touchHandled||(this.touchHandled=!0,this.touchMoved=!1,e.preventDefault())},touchmoveHandler:function(t){if(this.touchHandled){if(t.preventDefault(),!this.touchMoved){e(this).hasClass("focused");console.log("orgChart: touchmove 1: "+t.touches.length+" touches, we have not moved, so simulate a drag start",t.touches),this.simulateMouseEvent(t,"dragstart")}this.touchMoved=!0;var n=e(i.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY)).closest("div.node");if(n.length>0){var s=n[0];n.is(".allowedDrop")?(console.log("orgChart: touchmove 2: this node ("+s.id+") is allowed to be a drop target"),this.touchTargetNode=s):(console.log("orgChart: touchmove 3: this node ("+s.id+") is NOT allowed to be a drop target"),this.touchTargetNode=null)}else console.log("orgchart: touchmove 4: not touching a node"),this.touchTargetNode=null}},touchendHandler:function(e){if(console.log("orgChart: touchend 1: touchHandled="+this.touchHandled+", touchMoved="+this.touchMoved+", "+e.target.innerText+" "),this.touchHandled){if(this.touchMoved){if(this.touchTargetNode){console.log("orgChart: touchend 3: moved to a node, so simulating drop");var t={delegateTarget:this.touchTargetNode};this.dropHandler(t),this.touchTargetNode=null}console.log("orgChart: touchend 4: simulating dragend"),this.simulateMouseEvent(e,"dragend")}else console.log("orgChart: touchend 5: moved, so simulating click"),this.simulateMouseEvent(e,"click");this.touchHandled=!1}else console.log("orgChart: touchend 2: not handled by us, so aborting")},simulateMouseEvent:function(e,n){if(!(e.originalEvent.touches.length>1)){var s=e.originalEvent.changedTouches[0],a=i.createEvent("MouseEvents");a.initMouseEvent(n,!0,!0,t,1,s.screenX,s.screenY,s.clientX,s.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(a)}},createNode:function(t,i,n){t.children&&e.each(t.children,function(e,i){i.parentId=t.id});var s=e.Deferred(),a=e("").addClass("node "+(t.className||"")+(i>=n.depth?" slide-up":""));n.nodeTemplate?a.append(n.nodeTemplate(t)):a.append('
    '+t[n.nodeTitle]+"
    ").append(void 0!==n.nodeContent?'
    '+(t[n.nodeContent]||"")+"
    ":"");var o=t.relationship||"";if(n.verticalDepth&&i+2>n.verticalDepth){if(i+1>=n.verticalDepth&&Number(o.substr(2,1))){var d=i+1>=n.depth?"plus":"minus";a.append('')}}else Number(o.substr(0,1))&&a.append(''),Number(o.substr(1,1))&&a.append(''),Number(o.substr(2,1))&&a.append('').children(".title").prepend('');return a.on("mouseenter mouseleave",this.nodeEnterLeaveHandler.bind(this)),a.on("click",this.nodeClickHandler.bind(this)),a.on("click",".topEdge",{nodeData:t},this.topEdgeClickHandler.bind(this)),a.on("click",".bottomEdge",{nodeData:t},this.bottomEdgeClickHandler.bind(this)),a.on("click",".leftEdge, .rightEdge",{nodeData:t},this.hEdgeClickHandler.bind(this)),a.on("click",".toggleBtn",this.toggleVNodes.bind(this)),n.draggable&&(a.on("dragstart",this.dragstartHandler.bind(this)).on("dragover",this.dragoverHandler.bind(this)).on("dragend",this.dragendHandler.bind(this)).on("drop",this.dropHandler.bind(this)).on("touchstart",this.touchstartHandler.bind(this)).on("touchmove",this.touchmoveHandler.bind(this)).on("touchend",this.touchendHandler.bind(this)),this.touchHandled=!1,this.touchMoved=!1,this.touchTargetNode=null),n.createNode&&n.createNode(a,t),s.resolve(a),s.promise()},buildHierarchy:function(t,i,n,s,a){var o,d=this,r=i.children,l=!!r&&r.length,h=!!(s.verticalDepth&&n+1>=s.verticalDepth);if(Object.keys(i).length>1&&(o=h?t:e("
    ').append(this.createNode(data)))) + .append('
    ') - .append($nodeChart)), siblingCount, 1); - $nodeChart.closest('tr').siblings().eq(0).addClass('hidden').find('.node').addClass('slide-down'); - $nodeChart.parent().siblings().addClass('hidden') - .slice(0, insertPostion).find('.node').addClass('slide-right') - .end().end().slice(insertPostion).find('.node').addClass('slide-left'); - callback(); - } - }); + this.buildHierarchy($nodeChart.closest('.orgchart'), data); + this.complementLine($nodeChart.next().children('tr:last').children().eq(insertPostion).after($('').append($nodeChart)), + siblingCount, 1); } }, // - addSiblings: function ($node, data, opts) { - var that = this; - this.buildSiblingNode($node.closest('table'), data, opts, function() { - $node.closest('.nodes').data('siblingsLoaded', true); - if (!$node.children('.leftEdge').length) { - $node.children('.topEdge').after(''); - } - that.showSiblings($node); - }); + addSiblings: function ($node, data) { + this.buildSiblingNode($node.closest('table'), data); + $node.closest('.nodes').data('siblingsLoaded', true); + if (!$node.children('.leftEdge').length) { + $node.children('.topEdge').after(''); + } + if (this.isInAction($node)) { + this.switchHorizontalArrow($node); + $node.children('.topEdge').removeClass('fa-chevron-up').addClass('fa-chevron-down'); + } }, // removeNodes: function ($node) { diff --git a/dist/js/jquery.orgchart.min.js b/dist/js/jquery.orgchart.min.js index 96a211e7..d30eb36d 100644 --- a/dist/js/jquery.orgchart.min.js +++ b/dist/js/jquery.orgchart.min.js @@ -1,2 +1,2 @@ -"use strict";!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require("jquery"),window,document):e(jQuery,window,document)}(function(e,t,i,n){var s=function(t,i){this.$chartContainer=e(t),this.opts=i,this.defaultOptions={nodeTitle:"name",nodeId:"id",toggleSiblingsResp:!1,depth:999,chartClass:"",exportButton:!1,exportFilename:"OrgChart",exportFileextension:"png",parentNodeSymbol:"fa-users",draggable:!1,direction:"t2b",pan:!1,zoom:!1,zoominLimit:7,zoomoutLimit:.5}};s.prototype={init:function(t){var i=this;this.options=e.extend({},this.defaultOptions,this.opts,t);var n=this.$chartContainer;this.$chart&&this.$chart.remove();var s=this.options.data,a=this.$chart=e("
    ",{data:{options:this.options},class:"orgchart"+(""!==this.options.chartClass?" "+this.options.chartClass:"")+("t2b"!==this.options.direction?" "+this.options.direction:""),click:function(t){e(t.target).closest(".node").length||a.find(".node.focused").removeClass("focused")}});return"undefined"!=typeof MutationObserver&&this.triggerInitEvent(),"object"===e.type(s)?s instanceof e?this.buildHierarchy(a,this.buildJsonDS(s.children()),0,this.options):this.buildHierarchy(a,this.options.ajaxURL?s:this.attachRel(s,"00"),0,this.options):(a.append(''),e.ajax({url:s,dataType:"json"}).done(function(e,t,n){i.buildHierarchy(a,i.options.ajaxURL?e:i.attachRel(e,"00"),0,i.options)}).fail(function(e,t,i){console.log(i)}).always(function(){a.children(".spinner").remove()})),n.append(a),this.options.exportButton&&!n.find(".oc-export-btn").length&&this.attachExportButton(),this.options.pan&&this.bindPan(),this.options.zoom&&this.bindZoom(),this},triggerInitEvent:function(){var t=this,i=new MutationObserver(function(n){i.disconnect();e:for(var s=0;s",{class:"oc-export-btn"+(""!==this.options.chartClass?" "+this.options.chartClass:""),text:"Export",click:function(e){e.preventDefault(),t.export()}});this.$chartContainer.append(i)},setOptions:function(e,t){return"string"==typeof e&&("pan"===e&&(t?this.bindPan():this.unbindPan()),"zoom"===e&&(t?this.bindZoom():this.unbindZoom())),"object"==typeof e&&(e.data?this.init(e):(void 0!==e.pan&&(e.pan?this.bindPan():this.unbindPan()),void 0!==e.zoom&&(e.zoom?this.bindZoom():this.unbindZoom()))),this},panStartHandler:function(t){var i=e(t.delegateTarget);if(e(t.target).closest(".node").length||t.touches&&t.touches.length>1)i.data("panning",!1);else{i.css("cursor","move").data("panning",!0);var n=0,s=0,a=i.css("transform");if("none"!==a){var o=a.split(",");-1===a.indexOf("3d")?(n=parseInt(o[4]),s=parseInt(o[5])):(n=parseInt(o[12]),s=parseInt(o[13]))}var d=0,r=0;if(t.targetTouches){if(1===t.targetTouches.length)d=t.targetTouches[0].pageX-n,r=t.targetTouches[0].pageY-s;else if(t.targetTouches.length>1)return}else d=t.pageX-n,r=t.pageY-s;i.on("mousemove touchmove",function(e){if(i.data("panning")){var t=0,n=0;if(e.targetTouches){if(1===e.targetTouches.length)t=e.targetTouches[0].pageX-d,n=e.targetTouches[0].pageY-r;else if(e.targetTouches.length>1)return}else t=e.pageX-d,n=e.pageY-r;var s=i.css("transform");if("none"===s)-1===s.indexOf("3d")?i.css("transform","matrix(1, 0, 0, 1, "+t+", "+n+")"):i.css("transform","matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, "+t+", "+n+", 0, 1)");else{var a=s.split(",");-1===s.indexOf("3d")?(a[4]=" "+t,a[5]=" "+n+")"):(a[12]=" "+t,a[13]=" "+n),i.css("transform",a.join(","))}}})}},panEndHandler:function(e){e.data.chart.data("panning")&&e.data.chart.data("panning",!1).css("cursor","default").off("mousemove")},bindPan:function(){this.$chartContainer.css("overflow","hidden"),this.$chart.on("mousedown touchstart",this.panStartHandler),e(i).on("mouseup touchend",{chart:this.$chart},this.panEndHandler)},unbindPan:function(){this.$chartContainer.css("overflow","auto"),this.$chart.off("mousedown touchstart",this.panStartHandler),e(i).off("mouseup touchend",this.panEndHandler)},zoomWheelHandler:function(e){var t=e.data.oc;e.preventDefault();var i=1+(e.originalEvent.deltaY>0?-.2:.2);t.setChartScale(t.$chart,i)},zoomStartHandler:function(e){if(e.touches&&2===e.touches.length){var t=e.data.oc;t.$chart.data("pinching",!0);var i=t.getPinchDist(e);t.$chart.data("pinchDistStart",i)}},zoomingHandler:function(e){var t=e.data.oc;if(t.$chart.data("pinching")){var i=t.getPinchDist(e);t.$chart.data("pinchDistEnd",i)}},zoomEndHandler:function(e){var t=e.data.oc;if(t.$chart.data("pinching")){t.$chart.data("pinching",!1);var i=t.$chart.data("pinchDistEnd")-t.$chart.data("pinchDistStart");i>0?t.setChartScale(t.$chart,1.2):i<0&&t.setChartScale(t.$chart,.8)}},bindZoom:function(){this.$chartContainer.on("wheel",{oc:this},this.zoomWheelHandler),this.$chartContainer.on("touchstart",{oc:this},this.zoomStartHandler),e(i).on("touchmove",{oc:this},this.zoomingHandler),e(i).on("touchend",{oc:this},this.zoomEndHandler)},unbindZoom:function(){this.$chartContainer.off("wheel",this.zoomWheelHandler),this.$chartContainer.off("touchstart",this.zoomStartHandler),e(i).off("touchmove",this.zoomingHandler),e(i).off("touchend",this.zoomEndHandler)},getPinchDist:function(e){return Math.sqrt((e.touches[0].clientX-e.touches[1].clientX)*(e.touches[0].clientX-e.touches[1].clientX)+(e.touches[0].clientY-e.touches[1].clientY)*(e.touches[0].clientY-e.touches[1].clientY))},setChartScale:function(e,i){var n=e.data("options"),s=e.css("transform"),a="",o=1;"none"===s?e.css("transform","scale("+i+","+i+")"):(a=s.split(","),-1===s.indexOf("3d")?(o=Math.abs(t.parseFloat(a[3])*i))>n.zoomoutLimit&&on.zoomoutLimit&&o0?1:0),e.children&&e.children.forEach(function(t){i.attachRel(t,"1"+(e.children.length>1?1:0))}),e},loopChart:function(t){var i=this,n=t.find("tr:first"),s={id:n.find(".node")[0].id};return n.siblings(":last").children().each(function(){s.children||(s.children=[]),s.children.push(i.loopChart(e(this)))}),s},getHierarchy:function(){if(void 0===this.$chart)return"Error: orgchart does not exist";if(!this.$chart.find(".node").length)return"Error: nodes do not exist";var e=!0;return this.$chart.find(".node").each(function(){if(!this.id)return e=!1,!1}),e?this.loopChart(this.$chart):"Error: All nodes of orghcart to be exported must have data-id attribute!"},getNodeState:function(e,t){var i={};if("parent"===(t=t||"self")){if((i=e.closest(".nodes").siblings(":first")).length)return i.is(".hidden")||!i.is(".hidden")&&i.closest(".nodes").is(".hidden")?{exist:!0,visible:!1}:{exist:!0,visible:!0}}else if("children"===t){if((i=e.closest("tr").siblings(":last")).length)return i.is(".hidden")?{exist:!0,visible:!1}:{exist:!0,visible:!0}}else if("siblings"===t){if((i=e.closest("table").parent().siblings()).length)return i.is(".hidden")||i.parent().is(".hidden")?{exist:!0,visible:!1}:{exist:!0,visible:!0}}else if((i=e).length)return i.closest(".nodes").length&&i.closest(".nodes").is(".hidden")||i.closest("table").parent().length&&i.closest("table").parent().is(".hidden")||i.parent().is("li")&&(i.closest("ul").is(".hidden")||i.closest("verticalNodes").is(".hidden"))?{exist:!0,visible:!1}:{exist:!0,visible:!0};return{exist:!1,visible:!1}},getRelatedNodes:function(t,i){return t&&t instanceof e&&t.is(".node")?"parent"===i?t.closest(".nodes").parent().children(":first").find(".node"):"children"===i?t.closest("tr").siblings(".nodes").children().find(".node:first"):"siblings"===i?t.closest("table").parent().siblings().find(".node:first"):e():e()},hideParentEnd:function(t){e(t.target).removeClass("sliding"),t.data.upperLevel.addClass("hidden").slice(1).removeAttr("style")},hideParent:function(e){var t=e.closest(".nodes").siblings();t.eq(0).find(".spinner").length&&e.closest(".orgchart").data("inAjax",!1),this.getNodeState(e,"siblings").visible&&this.hideSiblings(e),t.slice(1).css("visibility","hidden");var i=t.eq(0).find(".node");this.getNodeState(i).visible&&i.addClass("sliding slide-down").one("transitionend",{upperLevel:t},this.hideParentEnd),this.getNodeState(i,"parent").visible&&this.hideParent(i)},showParentEnd:function(t){var i=t.data.node;e(t.target).removeClass("sliding"),this.isInAction(i)&&this.switchVerticalArrow(i.children(".topEdge"))},showParent:function(e){var t=e.closest(".nodes").siblings().removeClass("hidden");t.eq(2).children().slice(1,-1).addClass("hidden");var i=t.eq(0).find(".node");this.repaint(i[0]),i.addClass("sliding").removeClass("slide-down").one("transitionend",{node:e},this.showParentEnd.bind(this))},stopAjax:function(e){e.find(".spinner").length&&e.closest(".orgchart").data("inAjax",!1)},isVisibleNode:function(t,i){return this.getNodeState(e(i)).visible},hideChildrenEnd:function(e){e.data.animatedNodes.removeClass("sliding"),e.data.isVerticalDesc?e.data.lowerLevel.addClass("hidden"):(e.data.animatedNodes.closest(".nodes").prevAll(".lines").removeAttr("style").addBack().addClass("hidden"),e.data.lowerLevel.last().find(".verticalNodes").addClass("hidden")),this.isInAction(e.data.node)&&this.switchVerticalArrow(e.data.node.children(".bottomEdge"))},hideChildren:function(e){var t=e.closest("tr").siblings();this.stopAjax(t.last());var i=t.last().find(".node").filter(this.isVisibleNode.bind(this)),n=!!t.last().is(".verticalNodes");n||i.closest("table").closest("tr").prevAll(".lines").css("visibility","hidden"),this.repaint(i.get(0)),i.addClass("sliding slide-up").eq(0).one("transitionend",{animatedNodes:i,lowerLevel:t,isVerticalDesc:n,node:e},this.hideChildrenEnd.bind(this))},showChildrenEnd:function(e){var t=e.data.node;e.data.animatedNodes.removeClass("sliding"),this.isInAction(t)&&this.switchVerticalArrow(t.children(".bottomEdge"))},showChildren:function(e){var t=e.closest("tr").siblings(),i=!!t.is(".verticalNodes")?t.removeClass("hidden").find(".node").filter(this.isVisibleNode.bind(this)):t.removeClass("hidden").eq(2).children().find(".node:first").filter(this.isVisibleNode.bind(this));this.repaint(i.get(0)),i.addClass("sliding").removeClass("slide-up").eq(0).one("transitionend",{node:e,animatedNodes:i},this.showChildrenEnd.bind(this))},hideSiblingsEnd:function(e){var t=e.data.node,i=e.data.nodeContainer,n=e.data.direction;e.data.lines.removeAttr("style");var s=n?"left"===n?i.prevAll(":not(.hidden)"):i.nextAll(":not(.hidden)"):i.siblings();i.closest(".nodes").prev().children(":not(.hidden)").slice(1,n?2*s.length+1:-1).addClass("hidden"),e.data.animatedNodes.removeClass("sliding"),s.find(".node:gt(0)").filter(this.isVisibleNode.bind(this)).removeClass("slide-left slide-right").addClass("slide-up"),s.find(".lines, .nodes, .verticalNodes").addClass("hidden").end().addClass("hidden"),this.isInAction(t)&&this.switchHorizontalArrow(t)},hideSiblings:function(e,t){var i=e.closest("table").parent();i.siblings().find(".spinner").length&&e.closest(".orgchart").data("inAjax",!1),t?"left"===t?i.prevAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-right"):i.nextAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-left"):(i.prevAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-right"),i.nextAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-left"));var n=i.siblings().find(".sliding"),s=n.closest(".nodes").prevAll(".lines").css("visibility","hidden");n.eq(0).one("transitionend",{node:e,nodeContainer:i,direction:t,animatedNodes:n,lines:s},this.hideSiblingsEnd.bind(this))},showSiblingsEnd:function(e){var t=e.data.node;e.data.visibleNodes.removeClass("sliding"),this.isInAction(t)&&(this.switchHorizontalArrow(t),t.children(".topEdge").removeClass("fa-chevron-up").addClass("fa-chevron-down"))},showRelatedParentEnd:function(t){e(t.target).removeClass("sliding")},showSiblings:function(t,i){var n=e();n=i?"left"===i?t.closest("table").parent().prevAll().removeClass("hidden"):t.closest("table").parent().nextAll().removeClass("hidden"):t.closest("table").parent().siblings().removeClass("hidden");var s=t.closest("table").closest("tr").siblings();if(i?s.eq(2).children(".hidden").slice(0,2*n.length).removeClass("hidden"):s.eq(2).children(".hidden").removeClass("hidden"),!this.getNodeState(t,"parent").visible){s.removeClass("hidden");var a=s.find(".node")[0];this.repaint(a),e(a).addClass("sliding").removeClass("slide-down").one("transitionend",this.showRelatedParentEnd)}var o=n.find(".node").filter(this.isVisibleNode.bind(this));this.repaint(o.get(0)),o.addClass("sliding").removeClass("slide-left slide-right"),o.eq(0).one("transitionend",{node:t,visibleNodes:o},this.showSiblingsEnd.bind(this))},startLoading:function(t){var i=this.$chart;return(void 0===i.data("inAjax")||!0!==i.data("inAjax"))&&(t.addClass("hidden"),t.parent().append('').children().not(".spinner").css("opacity",.2),i.data("inAjax",!0),e(".oc-export-btn"+(""!==this.options.chartClass?"."+this.options.chartClass:"")).prop("disabled",!0),!0)},endLoading:function(t){var i=t.parent();t.removeClass("hidden"),i.find(".spinner").remove(),i.children().removeAttr("style"),this.$chart.data("inAjax",!1),e(".oc-export-btn"+(""!==this.options.chartClass?"."+this.options.chartClass:"")).prop("disabled",!1)},isInAction:function(e){return e.children(".edge").attr("class").indexOf("fa-")>-1},switchVerticalArrow:function(e){e.toggleClass("fa-chevron-up").toggleClass("fa-chevron-down")},switchHorizontalArrow:function(e){var t=e.closest(".orgchart").data("options");if(t.toggleSiblingsResp&&(void 0===t.ajaxURL||e.closest(".nodes").data("siblingsLoaded"))){var i=e.closest("table").parent().prev();i.length&&(i.is(".hidden")?e.children(".leftEdge").addClass("fa-chevron-left").removeClass("fa-chevron-right"):e.children(".leftEdge").addClass("fa-chevron-right").removeClass("fa-chevron-left"));var n=e.closest("table").parent().next();n.length&&(n.is(".hidden")?e.children(".rightEdge").addClass("fa-chevron-right").removeClass("fa-chevron-left"):e.children(".rightEdge").addClass("fa-chevron-left").removeClass("fa-chevron-right"))}else{var s=e.closest("table").parent().siblings(),a=!!s.length&&!s.is(".hidden");e.children(".leftEdge").toggleClass("fa-chevron-right",a).toggleClass("fa-chevron-left",!a),e.children(".rightEdge").toggleClass("fa-chevron-left",a).toggleClass("fa-chevron-right",!a)}},repaint:function(e){e&&(e.style.offsetWidth=e.offsetWidth)},nodeEnterLeaveHandler:function(t){var i=e(t.delegateTarget),n=!1,s=i.children(".topEdge"),a=(i.children(".rightEdge"),i.children(".bottomEdge")),o=i.children(".leftEdge");"mouseenter"===t.type?(s.length&&(n=this.getNodeState(i,"parent").visible,s.toggleClass("fa-chevron-up",!n).toggleClass("fa-chevron-down",n)),a.length&&(n=this.getNodeState(i,"children").visible,a.toggleClass("fa-chevron-down",!n).toggleClass("fa-chevron-up",n)),o.length&&this.switchHorizontalArrow(i)):i.children(".edge").removeClass("fa-chevron-up fa-chevron-down fa-chevron-right fa-chevron-left")},nodeClickHandler:function(t){this.$chart.find(".focused").removeClass("focused"),e(t.delegateTarget).addClass("focused")},loadNodes:function(t,i,n){var s=this,a=this.options;e.ajax({url:i,dataType:"json"}).done(function(i){s.$chart.data("inAjax")&&("parent"===t?e.isEmptyObject(i)||s.addParent(n.parent(),i,a):"children"===t?i.children.length&&s.addChildren(n.parent(),i,e.extend({},a,{depth:0})):(i.siblings||i.children)&&s.addSiblings(n.parent(),i,a))}).fail(function(){console.log("Failed to get "+t+" data")}).always(function(){s.endLoading(n)})},HideFirstParentEnd:function(e){var t=e.data.topEdge,i=t.parent();this.isInAction(i)&&(this.switchVerticalArrow(t),this.switchHorizontalArrow(i))},topEdgeClickHandler:function(t){t.stopPropagation();var i=e(t.target),n=e(t.delegateTarget),s=this.getNodeState(n,"parent");if(s.exist){var a=n.closest("table").closest("tr").siblings(":first").find(".node");if(a.is(".sliding"))return;s.visible?(this.hideParent(n),a.one("transitionend",{topEdge:i},this.HideFirstParentEnd.bind(this))):this.showParent(n)}else if(this.startLoading(i)){var o=this.options,d=e.isFunction(o.ajaxURL.parent)?o.ajaxURL.parent(t.data.nodeData):o.ajaxURL.parent+n[0].id;this.loadNodes("parent",d,i)}},bottomEdgeClickHandler:function(t){t.stopPropagation();var i=e(t.target),n=e(t.delegateTarget),s=this.getNodeState(n,"children");if(s.exist){if(n.closest("tr").siblings(":last").find(".sliding").length)return;s.visible?this.hideChildren(n):this.showChildren(n)}else if(this.startLoading(i)){var a=this.options,o=e.isFunction(a.ajaxURL.children)?a.ajaxURL.children(t.data.nodeData):a.ajaxURL.children+n[0].id;this.loadNodes("children",o,i)}},hEdgeClickHandler:function(t){t.stopPropagation();var i=e(t.target),n=e(t.delegateTarget),s=this.options,a=this.getNodeState(n,"siblings");if(a.exist){if(n.closest("table").parent().siblings().find(".sliding").length)return;if(s.toggleSiblingsResp){var o=n.closest("table").parent().prev(),d=n.closest("table").parent().next();i.is(".leftEdge")?o.is(".hidden")?this.showSiblings(n,"left"):this.hideSiblings(n,"left"):d.is(".hidden")?this.showSiblings(n,"right"):this.hideSiblings(n,"right")}else a.visible?this.hideSiblings(n):this.showSiblings(n)}else if(this.startLoading(i)){var r=n[0].id,l=this.getNodeState(n,"parent").exist?e.isFunction(s.ajaxURL.siblings)?s.ajaxURL.siblings(t.data.nodeData):s.ajaxURL.siblings+r:e.isFunction(s.ajaxURL.families)?s.ajaxURL.families(t.data.nodeData):s.ajaxURL.families+r;this.loadNodes("siblings",l,i)}},expandVNodesEnd:function(e){e.data.vNodes.removeClass("sliding")},collapseVNodesEnd:function(e){e.data.vNodes.removeClass("sliding").closest("ul").addClass("hidden")},toggleVNodes:function(t){var i=e(t.target),n=i.parent().next(),s=n.find(".node"),a=n.children().children(".node");a.is(".sliding")||(i.toggleClass("fa-plus-square fa-minus-square"),s.eq(0).is(".slide-up")?(n.removeClass("hidden"),this.repaint(a.get(0)),a.addClass("sliding").removeClass("slide-up").eq(0).one("transitionend",{vNodes:a},this.expandVNodesEnd)):(s.addClass("sliding slide-up").eq(0).one("transitionend",{vNodes:s},this.collapseVNodesEnd),s.find(".toggleBtn").removeClass("fa-minus-square").addClass("fa-plus-square")))},createGhostNode:function(n){var s=e(n.target),a=this.options,o=n.originalEvent,d=/firefox/.test(t.navigator.userAgent.toLowerCase());d&&o.dataTransfer.setData("text/html","hack for firefox");var r,l;i.querySelector(".ghost-node")?(r=s.closest(".orgchart").children(".ghost-node").get(0),l=e(r).children().get(0)):((r=i.createElementNS("http://www.w3.org/2000/svg","svg")).classList.add("ghost-node"),l=i.createElementNS("http://www.w3.org/2000/svg","rect"),r.appendChild(l),s.closest(".orgchart").append(r));var h=s.closest(".orgchart").css("transform").split(","),c=Math.abs(t.parseFloat("t2b"===a.direction||"b2t"===a.direction?h[0].slice(h[0].indexOf("(")+1):h[1]));r.setAttribute("width",s.outerWidth(!1)),r.setAttribute("height",s.outerHeight(!1)),l.setAttribute("x",5*c),l.setAttribute("y",5*c),l.setAttribute("width",120*c),l.setAttribute("height",40*c),l.setAttribute("rx",4*c),l.setAttribute("ry",4*c),l.setAttribute("stroke-width",1*c);var g=o.offsetX*c,p=o.offsetY*c;if("l2r"===a.direction?(g=o.offsetY*c,p=o.offsetX*c):"r2l"===a.direction?(g=s.outerWidth(!1)-o.offsetY*c,p=o.offsetX*c):"b2t"===a.direction&&(g=s.outerWidth(!1)-o.offsetX*c,p=s.outerHeight(!1)-o.offsetY*c),d){l.setAttribute("fill","rgb(255, 255, 255)"),l.setAttribute("stroke","rgb(191, 0, 0)");var f=i.createElement("img");f.src="data:image/svg+xml;utf8,"+(new XMLSerializer).serializeToString(r),o.dataTransfer.setDragImage(f,g,p)}else o.dataTransfer.setDragImage(r,g,p)},filterAllowedDropNodes:function(t){var i=this.options,n=t.closest(".nodes").siblings().eq(0).find(".node:first"),s=t.closest("table").find(".node");this.$chart.data("dragged",t).find(".node").each(function(a,o){-1===s.index(o)&&(i.dropCriteria?i.dropCriteria(t,n,e(o))&&e(o).addClass("allowedDrop"):e(o).addClass("allowedDrop"))})},dragstartHandler:function(t){"none"!==this.$chart.css("transform")&&this.createGhostNode(t),this.filterAllowedDropNodes(e(t.target))},dragoverHandler:function(t){t.preventDefault(),e(t.delegateTarget).is(".allowedDrop")||(t.originalEvent.dataTransfer.dropEffect="none")},dragendHandler:function(e){this.$chart.find(".allowedDrop").removeClass("allowedDrop")},dropHandler:function(t){var i=e(t.delegateTarget),n=this.$chart.data("dragged"),s=n.closest(".nodes").siblings().eq(0).children(),a=e.Event("nodedrop.orgchart");if(this.$chart.trigger(a,{draggedNode:n,dragZone:s.children(),dropZone:i}),!a.isDefaultPrevented()){if(i.closest("tr").siblings().length){var o=parseInt(i.parent().attr("colspan"))+2,d='';i.closest("tr").next().addBack().children().attr("colspan",o),n.find(".horizontalEdge").length||n.append(d),i.closest("tr").siblings().eq(1).children(":last").before('
    "),h||t.append(o),e.when(this.createNode(i,n,s)).done(function(t){h?o.append(t):o.append(e("").append(e("").append(t))),a&&a()}).fail(function(){console.log("Failed to creat node")})),l){1===Object.keys(i).length&&(o=t);var c=n+1>=s.depth||i.collapsed?" hidden":"",g=!!(s.verticalDepth&&n+2>=s.verticalDepth);g||o.append('');for(var p='',f=1;f';p+='';var u;g?(u=e("
      "),c&&s.depth+1!==s.verticalDepth&&u.addClass(c),n+2===s.verticalDepth?o.append('
    ').find(".verticalNodes").children().append(u):o.append(u)):(u=e(''),o.append(p).append(u)),e.each(r,function(){var t=e(g?"
  • ":'
  • ');u.append(t),d.buildHierarchy(t,this,n+1,s,a)})}},buildChildNode:function(e,t,i,n){var i=i||e.closest(".orgchart").data("options"),s=t.children||t.siblings;e.find("td:first").attr("colspan",2*s.length),this.buildHierarchy(e,{children:s},0,i,n)},addChildren:function(e,t,i){var n=this,i=i||e.closest(".orgchart").data("options"),s=0;this.buildChildNode(e.closest("table"),t,i,function(){++s===t.children.length&&(e.children(".bottomEdge").length||e.append(''),e.find(".symbol").length||e.children(".title").prepend(''),n.showChildren(e))})},buildParentNode:function(t,i,n,s){var a=this,o=e("");i.relationship=i.relationship||"001",e.when(this.createNode(i,0,n||t.closest(".orgchart").data("options"))).done(function(t){o.append(e('').append(e('');o.append('');var i=a.$chart;i.prepend(o).children("table:first").append('').children("tr:last").children().append(i.children("table").last()),s()}).fail(function(){console.log("Failed to create parent node")})},addParent:function(e,t,i){var n=this;this.buildParentNode(e,t,i,function(){e.children(".topEdge").length||e.children(".title").after(''),n.showParent(e)})},complementLine:function(e,t,i){for(var n="",s=0;s';e.parent().prevAll("tr:gt(0)").children().attr("colspan",2*t).end().next().children(":first").after(n)},buildSiblingNode:function(t,i,n,s){var a=this,n=n||t.closest(".orgchart").data("options"),o=i.siblings?i.siblings.length:i.children.length,d=t.parent().is("td")?t.closest("tr").children().length:1,r=d+o,l=r>1?Math.floor(r/2-1):0;if(t.parent().is("td")){t.closest("tr").prevAll("tr:last");t.closest("tr").prevAll("tr:lt(2)").remove();var h=0;this.buildChildNode(t.parent().closest("table"),i,n,function(){if(++h===o){var e=t.parent().closest("table").children("tr:last").children("td");d>1?(a.complementLine(e.eq(0).before(t.closest("td").siblings().addBack().unwrap()),r,d),e.addClass("hidden").find(".node").addClass("slide-left")):(a.complementLine(e.eq(l).after(t.closest("td").unwrap()),r,1),e.not(":eq("+l+"1)").addClass("hidden").slice(0,l).find(".node").addClass("slide-right").end().end().slice(l).find(".node").addClass("slide-left")),s()}})}else{var c=0;this.buildHierarchy(t.closest(".orgchart"),i,0,n,function(){++c===r&&(a.complementLine(t.next().children("tr:last").children().eq(l).after(e('').end().next().append(n.closest("table").parent());var r=n.closest("table").parent().siblings().find(".node:first");1===r.length&&r.append(d)}else i.append('').parent().attr("colspan",2).parent().after('').siblings(":last").append(n.find(".horizontalEdge").remove().end().closest("table").parent());var l=parseInt(s.attr("colspan"));if(l>2){s.attr("colspan",l-2).parent().next().children().attr("colspan",l-2).end().next().children().slice(1,3).remove();var h=s.parent().siblings(".nodes").children().find(".node:first");1===h.length&&h.find(".horizontalEdge").remove()}else s.removeAttr("colspan").find(".bottomEdge").remove().end().end().siblings().remove()}},touchstartHandler:function(e){console.log("orgChart: touchstart 1: touchHandled="+this.touchHandled+", touchMoved="+this.touchMoved+", target="+e.target.innerText),this.touchHandled||(this.touchHandled=!0,this.touchMoved=!1,e.preventDefault())},touchmoveHandler:function(t){if(this.touchHandled){if(t.preventDefault(),!this.touchMoved){e(this).hasClass("focused");console.log("orgChart: touchmove 1: "+t.touches.length+" touches, we have not moved, so simulate a drag start",t.touches),this.simulateMouseEvent(t,"dragstart")}this.touchMoved=!0;var n=e(i.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY)).closest("div.node");if(n.length>0){var s=n[0];n.is(".allowedDrop")?(console.log("orgChart: touchmove 2: this node ("+s.id+") is allowed to be a drop target"),this.touchTargetNode=s):(console.log("orgChart: touchmove 3: this node ("+s.id+") is NOT allowed to be a drop target"),this.touchTargetNode=null)}else console.log("orgchart: touchmove 4: not touching a node"),this.touchTargetNode=null}},touchendHandler:function(e){if(console.log("orgChart: touchend 1: touchHandled="+this.touchHandled+", touchMoved="+this.touchMoved+", "+e.target.innerText+" "),this.touchHandled){if(this.touchMoved){if(this.touchTargetNode){console.log("orgChart: touchend 3: moved to a node, so simulating drop");var t={delegateTarget:this.touchTargetNode};this.dropHandler(t),this.touchTargetNode=null}console.log("orgChart: touchend 4: simulating dragend"),this.simulateMouseEvent(e,"dragend")}else console.log("orgChart: touchend 5: moved, so simulating click"),this.simulateMouseEvent(e,"click");this.touchHandled=!1}else console.log("orgChart: touchend 2: not handled by us, so aborting")},simulateMouseEvent:function(e,n){if(!(e.originalEvent.touches.length>1)){var s=e.originalEvent.changedTouches[0],a=i.createEvent("MouseEvents");a.initMouseEvent(n,!0,!0,t,1,s.screenX,s.screenY,s.clientX,s.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(a)}},bindDragDrop:function(e){e.on("dragstart",this.dragstartHandler.bind(this)).on("dragover",this.dragoverHandler.bind(this)).on("dragend",this.dragendHandler.bind(this)).on("drop",this.dropHandler.bind(this)).on("touchstart",this.touchstartHandler.bind(this)).on("touchmove",this.touchmoveHandler.bind(this)).on("touchend",this.touchendHandler.bind(this))},createNode:function(t){var i=this.options,n=t.level;t.children&&e.each(t.children,function(e,i){i.parentId=t.id});var s=e("").addClass("node "+(t.className||"")+(n>i.visibleLevel?" slide-up":""));i.nodeTemplate?s.append(i.nodeTemplate(t)):s.append('
    '+t[i.nodeTitle]+"
    ").append(void 0!==i.nodeContent?'
    '+(t[i.nodeContent]||"")+"
    ":"");var a=t.relationship||"";if(i.verticalLevel&&n>=i.verticalLevel){if(n+1>i.verticalLevel&&Number(a.substr(2,1))){var o=n+1>i.visibleLevel?"plus":"minus";s.append('')}}else Number(a.substr(0,1))&&s.append(''),Number(a.substr(1,1))&&s.append(''),Number(a.substr(2,1))&&s.append('').children(".title").prepend('');return s.on("mouseenter mouseleave",this.nodeEnterLeaveHandler.bind(this)),s.on("click",this.nodeClickHandler.bind(this)),s.on("click",".topEdge",{nodeData:t},this.topEdgeClickHandler.bind(this)),s.on("click",".bottomEdge",{nodeData:t},this.bottomEdgeClickHandler.bind(this)),s.on("click",".leftEdge, .rightEdge",{nodeData:t},this.hEdgeClickHandler.bind(this)),s.on("click",".toggleBtn",this.toggleVNodes.bind(this)),i.draggable&&(this.bindDragDrop(s),this.touchHandled=!1,this.touchMoved=!1,this.touchTargetNode=null),i.createNode&&i.createNode(s,t),s},buildHierarchy:function(t,i){var n=this,s=this.options,a=0;a=i.level?i.level:i.level=t.parentsUntil(".orgchart",".nodes").length+1;var o,d=i.children,r=!!d&&d.length;if(Object.keys(i).length>2){var l=this.createNode(i);s.verticalLevel&&a>=s.verticalLevel?t.append(l):(o=e("
    ').append(t)),r,1),t.closest("tr").siblings().eq(0).addClass("hidden").find(".node").addClass("slide-down"),t.parent().siblings().addClass("hidden").slice(0,l).find(".node").addClass("slide-right").end().end().slice(l).find(".node").addClass("slide-left"),s())})}},addSiblings:function(e,t,i){var n=this;this.buildSiblingNode(e.closest("table"),t,i,function(){e.closest(".nodes").data("siblingsLoaded",!0),e.children(".leftEdge").length||e.children(".topEdge").after(''),n.showSiblings(e)})},removeNodes:function(e){var t=e.closest("table").parent(),i=t.parent().siblings();t.is("td")?this.getNodeState(e,"siblings").exist?(i.eq(2).children(".topLine:lt(2)").remove(),i.slice(0,2).children().attr("colspan",i.eq(2).children().length),t.remove()):i.eq(0).children().removeAttr("colspan").find(".bottomEdge").remove().end().end().siblings().remove():t.add(t.siblings()).remove()},export:function(n,s){var a=this;if(n=void 0!==n?n:this.options.exportFilename,s=void 0!==s?s:this.options.exportFileextension,e(this).children(".spinner").length)return!1;var o=this.$chartContainer,d=o.find(".mask");d.length?d.removeClass("hidden"):o.append('
    ');var r=o.addClass("canvasContainer").find('.orgchart:not(".hidden")').get(0),l="l2r"===a.options.direction||"r2l"===a.options.direction;html2canvas(r,{width:l?r.clientHeight:r.clientWidth,height:l?r.clientWidth:r.clientHeight,onclone:function(t){e(t).find(".canvasContainer").css("overflow","visible").find('.orgchart:not(".hidden"):first').css("transform","")},onrendered:function(e){if(o.find(".mask").addClass("hidden"),"pdf"===s.toLowerCase()){var d={},r=Math.floor(.2646*e.width),l=Math.floor(.2646*e.height);(d=r>l?new jsPDF("l","mm",[r,l]):new jsPDF("p","mm",[l,r])).addImage(e.toDataURL(),"png",0,0),d.save(n+".pdf")}else{var h="WebkitAppearance"in i.documentElement.style,c=!!t.sidebar,g="Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&navigator.appVersion.indexOf("Edge")>-1;if(!h&&!c||g)t.navigator.msSaveBlob(e.msToBlob(),n+".png");else{var p=".oc-download-btn"+(""!==a.options.chartClass?"."+a.options.chartClass:"");o.find(p).length||o.append(''),o.find(p).attr("href",e.toDataURL())[0].click()}}}}).then(function(){o.removeClass("canvasContainer")},function(){o.removeClass("canvasContainer")})}},e.fn.orgchart=function(e){return new s(this,e).init()}}); -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxdWVyeS5vcmdjaGFydC5qcyJdLCJuYW1lcyI6WyJmYWN0b3J5IiwibW9kdWxlIiwiZXhwb3J0cyIsInJlcXVpcmUiLCJ3aW5kb3ciLCJkb2N1bWVudCIsImpRdWVyeSIsIiQiLCJ1bmRlZmluZWQiLCJPcmdDaGFydCIsImVsZW0iLCJvcHRzIiwidGhpcyIsIiRjaGFydENvbnRhaW5lciIsImRlZmF1bHRPcHRpb25zIiwibm9kZVRpdGxlIiwibm9kZUlkIiwidG9nZ2xlU2libGluZ3NSZXNwIiwiZGVwdGgiLCJjaGFydENsYXNzIiwiZXhwb3J0QnV0dG9uIiwiZXhwb3J0RmlsZW5hbWUiLCJleHBvcnRGaWxlZXh0ZW5zaW9uIiwicGFyZW50Tm9kZVN5bWJvbCIsImRyYWdnYWJsZSIsImRpcmVjdGlvbiIsInBhbiIsInpvb20iLCJ6b29taW5MaW1pdCIsInpvb21vdXRMaW1pdCIsInByb3RvdHlwZSIsImluaXQiLCJ0aGF0Iiwib3B0aW9ucyIsImV4dGVuZCIsIiRja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ICB9XG5cbiAgICAgIGlmICh0aGlzLm9wdGlvbnMuem9vbSkge1xuICAgICAgICB0aGlzLmJpbmRab29tKCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG4gICAgLy9cbiAgICB0cmlnZ2VySW5pdEV2ZW50OiBmdW5jdGlvbiAoKSB7XG4gICAgICB2YXIgdGhhdCA9IHRoaXM7XG4gICAgICB2YXIgbW8gPSBuZXcgTXV0YXRpb25PYnNlcnZlcihmdW5jdGlvbiAobXV0YXRpb25zKSB7XG4gICAgICAgIG1vLmRpc2Nvbm5lY3QoKTtcbiAgICAgICAgaW5pdFRpbWU6XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbXV0YXRpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtdXRhdGlvbnNbaV0uYWRkZWROb2Rlcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgaWYgKG11dGF0aW9uc1tpXS5hZGRlZE5vZGVzW2pdLmNsYXNzTGlzdC5jb250YWlucygnb3JnY2hhcnQnKSkge1xuICAgICAgICAgICAgICBpZiAodGhhdC5vcHRpb25zLmluaXRDb21wbGV0ZWQgJiYgdHlwZW9mIHRoYXQub3B0aW9ucy5pbml0Q29tcGxldGVkID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgdGhhdC5vcHRpb25zLmluaXRDb21wbGV0ZWQodGhhdC4kY2hhcnQpO1xuICAgICAgICAgICAgICAgIHZhciBpbml0RXZlbnQgPSAkLkV2ZW50KCdpbml0Lm9yZ2NoYXJ0Jyk7XG4gICAgICAgICAgICAgICAgdGhhdC4kY2hhcnQudHJpZ2dlcihpbml0RXZlbnQpO1xuICAgICAgICAgICAgICAgIGJyZWFrIGluaXRUaW1lO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiA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W5iaW5kWm9vbSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHR5cGVvZiBvcHRzID09PSAnb2JqZWN0Jykge1xuICAgICAgICBpZiAob3B0cy5kYXRhKSB7XG4gICAgICAgICAgdGhpcy5pbml0KG9wdHMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICh0eXBlb2Ygb3B0cy5wYW4gIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAob3B0cy5wYW4pIHtcbiAgICAgICAgICAgICAgdGhpcy5iaW5kUGFuKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLnVuYmluZFBhbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodHlwZW9mIG9wdHMuem9vbSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChvcHRzLnpvb20pIHtcbiAgICAgICAgICAgICAgdGhpcy5iaW5kWm9vbSgpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy51bmJpbmRab29tKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG4gICAgLy9cbiAgICBwYW5TdGFydEhhbmRsZXI6IGZ1bmN0aW9uIChlKSB7XG4gICAgICB2YXIgJGNoYXJ0ID0gJChlLmRlbGVnYXRlVGFyZ2V0KTtcbiAgICAgIGlmICgkKGUudGFyZ2V0KS5jbG9zZXN0KCcubm9kZScpLmxlbmd0aCB8fCAoZS50b3VjaGVzICYmIGUudG91Y2hlcy5sZW5ndGggPiAxKSkge1xuICAgICAgICAkY2hhcnQuZGF0YSgncGFubmluZycsIGZhbHNlKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgJGNoYX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Ghpcy5vcHRpb25zO1xuICAgICAgdmFyIHNpYmxpbmdzU3RhdGUgPSB0aGlzLmdldE5vZGVTdGF0ZSgkbm9kZSwgJ3NpYmxpbmdzJyk7XG4gICAgICBpZiAoc2libGluZ3NTdGF0ZS5leGlzdCkge1xuICAgICAgICB2YXIgJHNpYmxpbmdzID0gJG5vZGUuY2xvc2VzdCgndGFibGUnKS5wYXJlbnQoKS5zaWJsaW5ncygpO1xuICAgICAgICBpZiAoJHNpYmxpbmdzLmZpbmQoJy5zbGlkaW5nJykubGVuZ3RoKSB7IHJldHVybjsgfVxuICAgICAgICBpZiAob3B0cy50b2dnbGVTaWJsaW5nc1Jlc3ApIHtcbiAgICAgICAgICB2YXIgJHByZXZTaWIgPSAkbm9kZS5jbG9zZXN0KCd0YWJsZScpLnBhcmVudCgpLnByZXYoKTtcbiAgICAgICAgICB2YXIgJG5leHRTaWIgPSAkbm9kZS5jbG9zZXN0KCd0YWJsZScpLnBhcmVudCgpLm5leHQoKTtcbiAgICAgICAgICBpZiAoJGhFZGdlLmlzKCcubGVmdEVkZ2UnKSkge1xuICAgICAgICAgICAgaWYgKCRwcmV2U2liLmlzKCcuaGlkZGVuJykpIHtcbiAgICAgICAgICAgICAgdGhpcy5zaG93U2libGluZ3MoJG5vZGUsICdsZWZ0Jyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmhpZGVTaWJsaW5ncygkbm9kZSwgJ2xlZnQnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCRuZXh0U2liLmlzKCcuaGlkZGVuJykpIHtcbiAgICAgICAgICAgICAgdGhpcy5zaG93U2libGluZ3MoJG5vZGUsICdyaWdodCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy5oaWRlU2libGluZ3MoJG5vZGUsICdyaWdodCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1c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AvLyB0eXBlXG4gICAgICAgIHRydWUsICAgICAgICAgICAgIC8vIGJ1YmJsZXMgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICB0cnVlLCAgICAgICAgICAgICAvLyBjYW5jZWxhYmxlICAgICAgICAgICAgICAgICBcbiAgICAgICAgd2luZG93LCAgICAgICAgICAgLy8gdmlldyAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIDEsICAgICAgICAgICAgICAgIC8vIGRldGFpbCAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICB0b3VjaC5zY3JlZW5YLCAgICAvLyBzY3JlZW5YICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgdG91Y2guc2NyZWVuWSwgICAgLy8gc2NyZWVuWSAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIHRvdWNoLmNsaWVudFgsICAgIC8vIGNsaWVudFggICAgICAgICAgICAgICAgICAgIFxuICAgICAgICB0b3VjaC5jbGllbnRZLCAgICAvLyBjbGllbnRZICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgZmFsc2UsICAgICAgICAgICAgLy8gY3RybEtleSAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIGZhbHNlLCAgICAgICAgICAgIC8vIGFsdEtleSAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICBmYWxzZSwgICAgICAgICAgICAvLyBzaGlmdEtleSAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgZmFsc2UsICAgICAgICAgICAgLy8gbWV0YUtleSAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIDAsICAgICAgICAgICAgICAgIC8vIGJ1dHRvbiAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICBudWxsICAgICAgICAgICAgICAvLyByZWxhdGVkVGFyZ2V0ICAgICAgICAgICAgICBcbiAgICAgICk7XG4gICAgICAvLyBEaXNwYXRjaCB0aGUgc2ltdWxhdGVkIGV2ZW50IHRvIHRoZSB0YXJnZXQgZWxlbWVudFxuICAgICAgZXZlbnQudGFy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RvcikuYXR0cignaHJlZicsIGNhbnZhcy50b0RhdGFVUkwoKSlbMF0uY2xpY2soKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICRjaGFydENvbnRhaW5lci5yZW1vdmVDbGFzcygnY2FudmFzQ29udGFpbmVyJyk7XG4gICAgICB9LCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICRjaGFydENvbnRhaW5lci5yZW1vdmVDbGFzcygnY2FudmFzQ29udGFpbmVyJyk7XG4gICAgICB9KTtcbiAgICB9XG4gIH07XG5cbiAgJC5mbi5vcmdjaGFydCA9IGZ1bmN0aW9uIChvcHRzKSB7XG4gICAgcmV0dXJuIG5ldyBPcmdDaGFydCh0aGlzLCBvcHRzKS5pbml0KCk7XG4gIH07XG5cbn0pKTtcbiJdfQ== +"use strict";!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require("jquery"),window,document):e(jQuery,window,document)}(function(e,t,i,n){var s=function(t,i){this.$chartContainer=e(t),this.opts=i,this.defaultOptions={nodeTitle:"name",nodeId:"id",toggleSiblingsResp:!1,visibleLevel:999,chartClass:"",exportButton:!1,exportFilename:"OrgChart",exportFileextension:"png",parentNodeSymbol:"fa-users",draggable:!1,direction:"t2b",pan:!1,zoom:!1,zoominLimit:7,zoomoutLimit:.5}};s.prototype={init:function(t){var i=this;this.options=e.extend({},this.defaultOptions,this.opts,t);var n=this.$chartContainer;this.$chart&&this.$chart.remove();var s=this.options.data,a=this.$chart=e("
    ",{data:{options:this.options},class:"orgchart"+(""!==this.options.chartClass?" "+this.options.chartClass:"")+("t2b"!==this.options.direction?" "+this.options.direction:""),click:function(t){e(t.target).closest(".node").length||a.find(".node.focused").removeClass("focused")}});return"undefined"!=typeof MutationObserver&&this.triggerInitEvent(),"object"===e.type(s)?s instanceof e?this.buildHierarchy(a,this.buildJsonDS(s.children()),0,this.options):this.buildHierarchy(a,this.options.ajaxURL?s:this.attachRel(s,"00")):(a.append(''),e.ajax({url:s,dataType:"json"}).done(function(e,t,n){i.buildHierarchy(a,i.options.ajaxURL?e:i.attachRel(e,"00"),0,i.options)}).fail(function(e,t,i){console.log(i)}).always(function(){a.children(".spinner").remove()})),n.append(a),this.options.exportButton&&!n.find(".oc-export-btn").length&&this.attachExportButton(),this.options.pan&&this.bindPan(),this.options.zoom&&this.bindZoom(),this},triggerInitEvent:function(){var t=this,i=new MutationObserver(function(n){i.disconnect();e:for(var s=0;s",{class:"oc-export-btn"+(""!==this.options.chartClass?" "+this.options.chartClass:""),text:"Export",click:function(e){e.preventDefault(),t.export()}});this.$chartContainer.append(i)},setOptions:function(e,t){return"string"==typeof e&&("pan"===e&&(t?this.bindPan():this.unbindPan()),"zoom"===e&&(t?this.bindZoom():this.unbindZoom())),"object"==typeof e&&(e.data?this.init(e):(void 0!==e.pan&&(e.pan?this.bindPan():this.unbindPan()),void 0!==e.zoom&&(e.zoom?this.bindZoom():this.unbindZoom()))),this},panStartHandler:function(t){var i=e(t.delegateTarget);if(e(t.target).closest(".node").length||t.touches&&t.touches.length>1)i.data("panning",!1);else{i.css("cursor","move").data("panning",!0);var n=0,s=0,a=i.css("transform");if("none"!==a){var o=a.split(",");-1===a.indexOf("3d")?(n=parseInt(o[4]),s=parseInt(o[5])):(n=parseInt(o[12]),s=parseInt(o[13]))}var d=0,r=0;if(t.targetTouches){if(1===t.targetTouches.length)d=t.targetTouches[0].pageX-n,r=t.targetTouches[0].pageY-s;else if(t.targetTouches.length>1)return}else d=t.pageX-n,r=t.pageY-s;i.on("mousemove touchmove",function(e){if(i.data("panning")){var t=0,n=0;if(e.targetTouches){if(1===e.targetTouches.length)t=e.targetTouches[0].pageX-d,n=e.targetTouches[0].pageY-r;else if(e.targetTouches.length>1)return}else t=e.pageX-d,n=e.pageY-r;var s=i.css("transform");if("none"===s)-1===s.indexOf("3d")?i.css("transform","matrix(1, 0, 0, 1, "+t+", "+n+")"):i.css("transform","matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, "+t+", "+n+", 0, 1)");else{var a=s.split(",");-1===s.indexOf("3d")?(a[4]=" "+t,a[5]=" "+n+")"):(a[12]=" "+t,a[13]=" "+n),i.css("transform",a.join(","))}}})}},panEndHandler:function(e){e.data.chart.data("panning")&&e.data.chart.data("panning",!1).css("cursor","default").off("mousemove")},bindPan:function(){this.$chartContainer.css("overflow","hidden"),this.$chart.on("mousedown touchstart",this.panStartHandler),e(i).on("mouseup touchend",{chart:this.$chart},this.panEndHandler)},unbindPan:function(){this.$chartContainer.css("overflow","auto"),this.$chart.off("mousedown touchstart",this.panStartHandler),e(i).off("mouseup touchend",this.panEndHandler)},zoomWheelHandler:function(e){var t=e.data.oc;e.preventDefault();var i=1+(e.originalEvent.deltaY>0?-.2:.2);t.setChartScale(t.$chart,i)},zoomStartHandler:function(e){if(e.touches&&2===e.touches.length){var t=e.data.oc;t.$chart.data("pinching",!0);var i=t.getPinchDist(e);t.$chart.data("pinchDistStart",i)}},zoomingHandler:function(e){var t=e.data.oc;if(t.$chart.data("pinching")){var i=t.getPinchDist(e);t.$chart.data("pinchDistEnd",i)}},zoomEndHandler:function(e){var t=e.data.oc;if(t.$chart.data("pinching")){t.$chart.data("pinching",!1);var i=t.$chart.data("pinchDistEnd")-t.$chart.data("pinchDistStart");i>0?t.setChartScale(t.$chart,1.2):i<0&&t.setChartScale(t.$chart,.8)}},bindZoom:function(){this.$chartContainer.on("wheel",{oc:this},this.zoomWheelHandler),this.$chartContainer.on("touchstart",{oc:this},this.zoomStartHandler),e(i).on("touchmove",{oc:this},this.zoomingHandler),e(i).on("touchend",{oc:this},this.zoomEndHandler)},unbindZoom:function(){this.$chartContainer.off("wheel",this.zoomWheelHandler),this.$chartContainer.off("touchstart",this.zoomStartHandler),e(i).off("touchmove",this.zoomingHandler),e(i).off("touchend",this.zoomEndHandler)},getPinchDist:function(e){return Math.sqrt((e.touches[0].clientX-e.touches[1].clientX)*(e.touches[0].clientX-e.touches[1].clientX)+(e.touches[0].clientY-e.touches[1].clientY)*(e.touches[0].clientY-e.touches[1].clientY))},setChartScale:function(e,i){var n=e.data("options"),s=e.css("transform"),a="",o=1;"none"===s?e.css("transform","scale("+i+","+i+")"):(a=s.split(","),-1===s.indexOf("3d")?(o=Math.abs(t.parseFloat(a[3])*i))>n.zoomoutLimit&&on.zoomoutLimit&&o0?1:0),e.children&&e.children.forEach(function(t){i.attachRel(t,"1"+(e.children.length>1?1:0))}),e},loopChart:function(t){var i=this,n=t.find("tr:first"),s={id:n.find(".node")[0].id};return n.siblings(":last").children().each(function(){s.children||(s.children=[]),s.children.push(i.loopChart(e(this)))}),s},getHierarchy:function(){if(void 0===this.$chart)return"Error: orgchart does not exist";if(!this.$chart.find(".node").length)return"Error: nodes do not exist";var e=!0;return this.$chart.find(".node").each(function(){if(!this.id)return e=!1,!1}),e?this.loopChart(this.$chart):"Error: All nodes of orghcart to be exported must have data-id attribute!"},getNodeState:function(e,t){var i={};if("parent"===(t=t||"self")){if((i=e.closest(".nodes").siblings(":first")).length)return i.is(".hidden")||!i.is(".hidden")&&i.closest(".nodes").is(".hidden")?{exist:!0,visible:!1}:{exist:!0,visible:!0}}else if("children"===t){if((i=e.closest("tr").siblings(":last")).length)return i.is(".hidden")?{exist:!0,visible:!1}:{exist:!0,visible:!0}}else if("siblings"===t){if((i=e.closest("table").parent().siblings()).length)return i.is(".hidden")||i.parent().is(".hidden")?{exist:!0,visible:!1}:{exist:!0,visible:!0}}else if((i=e).length)return i.closest(".nodes").length&&i.closest(".nodes").is(".hidden")||i.closest("table").parent().length&&i.closest("table").parent().is(".hidden")||i.parent().is("li")&&(i.closest("ul").is(".hidden")||i.closest("verticalNodes").is(".hidden"))?{exist:!0,visible:!1}:{exist:!0,visible:!0};return{exist:!1,visible:!1}},getRelatedNodes:function(t,i){return t&&t instanceof e&&t.is(".node")?"parent"===i?t.closest(".nodes").parent().children(":first").find(".node"):"children"===i?t.closest("tr").siblings(".nodes").children().find(".node:first"):"siblings"===i?t.closest("table").parent().siblings().find(".node:first"):e():e()},hideParentEnd:function(t){e(t.target).removeClass("sliding"),t.data.upperLevel.addClass("hidden").slice(1).removeAttr("style")},hideParent:function(e){var t=e.closest(".nodes").siblings();t.eq(0).find(".spinner").length&&e.closest(".orgchart").data("inAjax",!1),this.getNodeState(e,"siblings").visible&&this.hideSiblings(e),t.slice(1).css("visibility","hidden");var i=t.eq(0).find(".node");this.getNodeState(i).visible&&i.addClass("sliding slide-down").one("transitionend",{upperLevel:t},this.hideParentEnd),this.getNodeState(i,"parent").visible&&this.hideParent(i)},showParentEnd:function(t){var i=t.data.node;e(t.target).removeClass("sliding"),this.isInAction(i)&&this.switchVerticalArrow(i.children(".topEdge"))},showParent:function(e){var t=e.closest(".nodes").siblings().removeClass("hidden");t.eq(2).children().slice(1,-1).addClass("hidden");var i=t.eq(0).find(".node");this.repaint(i[0]),i.addClass("sliding").removeClass("slide-down").one("transitionend",{node:e},this.showParentEnd.bind(this))},stopAjax:function(e){e.find(".spinner").length&&e.closest(".orgchart").data("inAjax",!1)},isVisibleNode:function(t,i){return this.getNodeState(e(i)).visible},hideChildrenEnd:function(e){var t=e.data.node;e.data.animatedNodes.removeClass("sliding"),e.data.isVerticalDesc?e.data.lowerLevel.addClass("hidden"):(e.data.animatedNodes.closest(".nodes").prevAll(".lines").removeAttr("style").addBack().addClass("hidden"),e.data.lowerLevel.last().find(".verticalNodes").addClass("hidden")),this.isInAction(t)&&this.switchVerticalArrow(t.children(".bottomEdge"))},hideChildren:function(e){var t=e.closest("tr").siblings();this.stopAjax(t.last());var i=t.last().find(".node").filter(this.isVisibleNode.bind(this)),n=!!t.last().is(".verticalNodes");n||i.closest("table").closest("tr").prevAll(".lines").css("visibility","hidden"),this.repaint(i.get(0)),i.addClass("sliding slide-up").eq(0).one("transitionend",{animatedNodes:i,lowerLevel:t,isVerticalDesc:n,node:e},this.hideChildrenEnd.bind(this))},showChildrenEnd:function(e){var t=e.data.node;e.data.animatedNodes.removeClass("sliding"),this.isInAction(t)&&this.switchVerticalArrow(t.children(".bottomEdge"))},showChildren:function(e){var t=e.closest("tr").siblings(),i=!!t.is(".verticalNodes")?t.removeClass("hidden").find(".node").filter(this.isVisibleNode.bind(this)):t.removeClass("hidden").eq(2).children().find(".node:first").filter(this.isVisibleNode.bind(this));this.repaint(i.get(0)),i.addClass("sliding").removeClass("slide-up").eq(0).one("transitionend",{node:e,animatedNodes:i},this.showChildrenEnd.bind(this))},hideSiblingsEnd:function(e){var t=e.data.node,i=e.data.nodeContainer,n=e.data.direction;e.data.lines.removeAttr("style");var s=n?"left"===n?i.prevAll(":not(.hidden)"):i.nextAll(":not(.hidden)"):i.siblings();i.closest(".nodes").prev().children(":not(.hidden)").slice(1,n?2*s.length+1:-1).addClass("hidden"),e.data.animatedNodes.removeClass("sliding"),s.find(".node:gt(0)").filter(this.isVisibleNode.bind(this)).removeClass("slide-left slide-right").addClass("slide-up"),s.find(".lines, .nodes, .verticalNodes").addClass("hidden").end().addClass("hidden"),this.isInAction(t)&&this.switchHorizontalArrow(t)},hideSiblings:function(e,t){var i=e.closest("table").parent();i.siblings().find(".spinner").length&&e.closest(".orgchart").data("inAjax",!1),t?"left"===t?i.prevAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-right"):i.nextAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-left"):(i.prevAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-right"),i.nextAll().find(".node").filter(this.isVisibleNode.bind(this)).addClass("sliding slide-left"));var n=i.siblings().find(".sliding"),s=n.closest(".nodes").prevAll(".lines").css("visibility","hidden");n.eq(0).one("transitionend",{node:e,nodeContainer:i,direction:t,animatedNodes:n,lines:s},this.hideSiblingsEnd.bind(this))},showSiblingsEnd:function(e){var t=e.data.node;e.data.visibleNodes.removeClass("sliding"),this.isInAction(t)&&(this.switchHorizontalArrow(t),t.children(".topEdge").removeClass("fa-chevron-up").addClass("fa-chevron-down"))},showRelatedParentEnd:function(t){e(t.target).removeClass("sliding")},showSiblings:function(t,i){var n=e();n=i?"left"===i?t.closest("table").parent().prevAll().removeClass("hidden"):t.closest("table").parent().nextAll().removeClass("hidden"):t.closest("table").parent().siblings().removeClass("hidden");var s=t.closest("table").closest("tr").siblings();if(i?s.eq(2).children(".hidden").slice(0,2*n.length).removeClass("hidden"):s.eq(2).children(".hidden").removeClass("hidden"),!this.getNodeState(t,"parent").visible){s.removeClass("hidden");var a=s.find(".node")[0];this.repaint(a),e(a).addClass("sliding").removeClass("slide-down").one("transitionend",this.showRelatedParentEnd)}var o=n.find(".node").filter(this.isVisibleNode.bind(this));this.repaint(o.get(0)),o.addClass("sliding").removeClass("slide-left slide-right"),o.eq(0).one("transitionend",{node:t,visibleNodes:o},this.showSiblingsEnd.bind(this))},startLoading:function(t){var i=this.$chart;return(void 0===i.data("inAjax")||!0!==i.data("inAjax"))&&(t.addClass("hidden"),t.parent().append('').children().not(".spinner").css("opacity",.2),i.data("inAjax",!0),e(".oc-export-btn"+(""!==this.options.chartClass?"."+this.options.chartClass:"")).prop("disabled",!0),!0)},endLoading:function(t){var i=t.parent();t.removeClass("hidden"),i.find(".spinner").remove(),i.children().removeAttr("style"),this.$chart.data("inAjax",!1),e(".oc-export-btn"+(""!==this.options.chartClass?"."+this.options.chartClass:"")).prop("disabled",!1)},isInAction:function(e){return e.children(".edge").attr("class").indexOf("fa-")>-1},switchVerticalArrow:function(e){e.toggleClass("fa-chevron-up").toggleClass("fa-chevron-down")},switchHorizontalArrow:function(e){var t=this.options;if(t.toggleSiblingsResp&&(void 0===t.ajaxURL||e.closest(".nodes").data("siblingsLoaded"))){var i=e.closest("table").parent().prev();i.length&&(i.is(".hidden")?e.children(".leftEdge").addClass("fa-chevron-left").removeClass("fa-chevron-right"):e.children(".leftEdge").addClass("fa-chevron-right").removeClass("fa-chevron-left"));var n=e.closest("table").parent().next();n.length&&(n.is(".hidden")?e.children(".rightEdge").addClass("fa-chevron-right").removeClass("fa-chevron-left"):e.children(".rightEdge").addClass("fa-chevron-left").removeClass("fa-chevron-right"))}else{var s=e.closest("table").parent().siblings(),a=!!s.length&&!s.is(".hidden");e.children(".leftEdge").toggleClass("fa-chevron-right",a).toggleClass("fa-chevron-left",!a),e.children(".rightEdge").toggleClass("fa-chevron-left",a).toggleClass("fa-chevron-right",!a)}},repaint:function(e){e&&(e.style.offsetWidth=e.offsetWidth)},nodeEnterLeaveHandler:function(t){var i=e(t.delegateTarget),n=!1,s=i.children(".topEdge"),a=(i.children(".rightEdge"),i.children(".bottomEdge")),o=i.children(".leftEdge");"mouseenter"===t.type?(s.length&&(n=this.getNodeState(i,"parent").visible,s.toggleClass("fa-chevron-up",!n).toggleClass("fa-chevron-down",n)),a.length&&(n=this.getNodeState(i,"children").visible,a.toggleClass("fa-chevron-down",!n).toggleClass("fa-chevron-up",n)),o.length&&this.switchHorizontalArrow(i)):i.children(".edge").removeClass("fa-chevron-up fa-chevron-down fa-chevron-right fa-chevron-left")},nodeClickHandler:function(t){this.$chart.find(".focused").removeClass("focused"),e(t.delegateTarget).addClass("focused")},loadNodes:function(t,i,n){var s=this;this.options;e.ajax({url:i,dataType:"json"}).done(function(i){s.$chart.data("inAjax")&&("parent"===t?e.isEmptyObject(i)||s.addParent(n.parent(),i):"children"===t?i.children.length&&s.addChildren(n.parent(),i[t]):s.addSiblings(n.parent(),i.siblings?i.siblings:i))}).fail(function(){console.log("Failed to get "+t+" data")}).always(function(){s.endLoading(n)})},HideFirstParentEnd:function(e){var t=e.data.topEdge,i=t.parent();this.isInAction(i)&&(this.switchVerticalArrow(t),this.switchHorizontalArrow(i))},topEdgeClickHandler:function(t){t.stopPropagation();var i=e(t.target),n=e(t.delegateTarget),s=this.getNodeState(n,"parent");if(s.exist){var a=n.closest("table").closest("tr").siblings(":first").find(".node");if(a.is(".sliding"))return;s.visible?(this.hideParent(n),a.one("transitionend",{topEdge:i},this.HideFirstParentEnd.bind(this))):this.showParent(n)}else if(this.startLoading(i)){var o=this.options,d=e.isFunction(o.ajaxURL.parent)?o.ajaxURL.parent(t.data.nodeData):o.ajaxURL.parent+n[0].id;this.loadNodes("parent",d,i)}},bottomEdgeClickHandler:function(t){t.stopPropagation();var i=e(t.target),n=e(t.delegateTarget),s=this.getNodeState(n,"children");if(s.exist){if(n.closest("tr").siblings(":last").find(".sliding").length)return;s.visible?this.hideChildren(n):this.showChildren(n)}else if(this.startLoading(i)){var a=this.options,o=e.isFunction(a.ajaxURL.children)?a.ajaxURL.children(t.data.nodeData):a.ajaxURL.children+n[0].id;this.loadNodes("children",o,i)}},hEdgeClickHandler:function(t){t.stopPropagation();var i=e(t.target),n=e(t.delegateTarget),s=this.options,a=this.getNodeState(n,"siblings");if(a.exist){if(n.closest("table").parent().siblings().find(".sliding").length)return;if(s.toggleSiblingsResp){var o=n.closest("table").parent().prev(),d=n.closest("table").parent().next();i.is(".leftEdge")?o.is(".hidden")?this.showSiblings(n,"left"):this.hideSiblings(n,"left"):d.is(".hidden")?this.showSiblings(n,"right"):this.hideSiblings(n,"right")}else a.visible?this.hideSiblings(n):this.showSiblings(n)}else if(this.startLoading(i)){var r=n[0].id,l=this.getNodeState(n,"parent").exist?e.isFunction(s.ajaxURL.siblings)?s.ajaxURL.siblings(t.data.nodeData):s.ajaxURL.siblings+r:e.isFunction(s.ajaxURL.families)?s.ajaxURL.families(t.data.nodeData):s.ajaxURL.families+r;this.loadNodes("siblings",l,i)}},expandVNodesEnd:function(e){e.data.vNodes.removeClass("sliding")},collapseVNodesEnd:function(e){e.data.vNodes.removeClass("sliding").closest("ul").addClass("hidden")},toggleVNodes:function(t){var i=e(t.target),n=i.parent().next(),s=n.find(".node"),a=n.children().children(".node");a.is(".sliding")||(i.toggleClass("fa-plus-square fa-minus-square"),s.eq(0).is(".slide-up")?(n.removeClass("hidden"),this.repaint(a.get(0)),a.addClass("sliding").removeClass("slide-up").eq(0).one("transitionend",{vNodes:a},this.expandVNodesEnd)):(s.addClass("sliding slide-up").eq(0).one("transitionend",{vNodes:s},this.collapseVNodesEnd),s.find(".toggleBtn").removeClass("fa-minus-square").addClass("fa-plus-square")))},createGhostNode:function(n){var s=e(n.target),a=this.options,o=n.originalEvent,d=/firefox/.test(t.navigator.userAgent.toLowerCase());d&&o.dataTransfer.setData("text/html","hack for firefox");var r,l;i.querySelector(".ghost-node")?(r=s.closest(".orgchart").children(".ghost-node").get(0),l=e(r).children().get(0)):((r=i.createElementNS("http://www.w3.org/2000/svg","svg")).classList.add("ghost-node"),l=i.createElementNS("http://www.w3.org/2000/svg","rect"),r.appendChild(l),s.closest(".orgchart").append(r));var h=s.closest(".orgchart").css("transform").split(","),c=Math.abs(t.parseFloat("t2b"===a.direction||"b2t"===a.direction?h[0].slice(h[0].indexOf("(")+1):h[1]));r.setAttribute("width",s.outerWidth(!1)),r.setAttribute("height",s.outerHeight(!1)),l.setAttribute("x",5*c),l.setAttribute("y",5*c),l.setAttribute("width",120*c),l.setAttribute("height",40*c),l.setAttribute("rx",4*c),l.setAttribute("ry",4*c),l.setAttribute("stroke-width",1*c);var g=o.offsetX*c,p=o.offsetY*c;if("l2r"===a.direction?(g=o.offsetY*c,p=o.offsetX*c):"r2l"===a.direction?(g=s.outerWidth(!1)-o.offsetY*c,p=o.offsetX*c):"b2t"===a.direction&&(g=s.outerWidth(!1)-o.offsetX*c,p=s.outerHeight(!1)-o.offsetY*c),d){l.setAttribute("fill","rgb(255, 255, 255)"),l.setAttribute("stroke","rgb(191, 0, 0)");var f=i.createElement("img");f.src="data:image/svg+xml;utf8,"+(new XMLSerializer).serializeToString(r),o.dataTransfer.setDragImage(f,g,p)}else o.dataTransfer.setDragImage(r,g,p)},filterAllowedDropNodes:function(t){var i=this.options,n=t.closest(".nodes").siblings().eq(0).find(".node:first"),s=t.closest("table").find(".node");this.$chart.data("dragged",t).find(".node").each(function(a,o){-1===s.index(o)&&(i.dropCriteria?i.dropCriteria(t,n,e(o))&&e(o).addClass("allowedDrop"):e(o).addClass("allowedDrop"))})},dragstartHandler:function(t){"none"!==this.$chart.css("transform")&&this.createGhostNode(t),this.filterAllowedDropNodes(e(t.target))},dragoverHandler:function(t){t.preventDefault(),e(t.delegateTarget).is(".allowedDrop")||(t.originalEvent.dataTransfer.dropEffect="none")},dragendHandler:function(e){this.$chart.find(".allowedDrop").removeClass("allowedDrop")},dropHandler:function(t){var i=e(t.delegateTarget),n=this.$chart.data("dragged"),s=n.closest(".nodes").siblings().eq(0).children(),a=e.Event("nodedrop.orgchart");if(this.$chart.trigger(a,{draggedNode:n,dragZone:s.children(),dropZone:i}),!a.isDefaultPrevented()){if(i.closest("tr").siblings().length){var o=parseInt(i.parent().attr("colspan"))+2,d='';i.closest("tr").next().addBack().children().attr("colspan",o),n.find(".horizontalEdge").length||n.append(d),i.closest("tr").siblings().eq(1).children(":last").before('
    "),t.append(o.append(e("").append(e("").append(l)))))}if(r){var h,c=a+1>s.visibleLevel||i.collapsed?" hidden":"",g=!!(s.verticalLevel&&a+1>=s.verticalLevel);if(g)h=e("
      "),c&&a+1>s.verticalLevel&&h.addClass(c),a+1===s.verticalLevel?t.children("table").append('
    ').find(".verticalNodes").children().append(h):t.append(h);else{for(var p=e(''),f='',v=1;v';f+='',h=e(''),2===Object.keys(i).length?t.append(p).append(f).append(h):o.append(p).append(f).append(h)}e.each(d,function(){var t=e(g?"
  • ":'
  • ');h.append(t),this.level=a+1,n.buildHierarchy(t,this)})}},buildChildNode:function(e,t){e.find("td:first").attr("colspan",2*t.length),this.buildHierarchy(e,{children:t})},addChildren:function(e,t){this.buildChildNode(e.closest("table"),t),e.children(".bottomEdge").length||e.append(''),e.find(".symbol").length||e.children(".title").prepend(''),this.isInAction(e)&&this.switchVerticalArrow(e.children(".bottomEdge"))},buildParentNode:function(t,i){i.relationship=i.relationship||"001";var n=e("").append(e("").append(e('').append('');this.$chart.prepend(n).children("table:first").append('').children("tr:last").children().append(this.$chart.children("table").last())},addParent:function(e,t){this.buildParentNode(e,t),e.children(".topEdge").length||e.children(".title").after(''),this.isInAction(e)&&this.switchVerticalArrow(e.children(".topEdge"))},complementLine:function(e,t,i){for(var n="",s=0;s';e.parent().prevAll("tr:gt(0)").children().attr("colspan",2*t).end().next().children(":first").after(n)},buildSiblingNode:function(t,i){var n=e.isArray(i)?i.length:i.children.length,s=t.parent().is("td")?t.closest("tr").children().length:1,a=s+n,o=a>1?Math.floor(a/2-1):0;if(t.parent().is("td")){t.closest("tr").prevAll("tr:last");t.closest("tr").prevAll("tr:lt(2)").remove(),this.buildChildNode(t.parent().closest("table"),i);var d=t.parent().closest("table").children("tr:last").children("td");s>1?this.complementLine(d.eq(0).before(t.closest("td").siblings().addBack().unwrap()),a,s):this.complementLine(d.eq(o).after(t.closest("td").unwrap()),a,1)}else this.buildHierarchy(t.closest(".orgchart"),i),this.complementLine(t.next().children("tr:last").children().eq(o).after(e('
    ').append(this.createNode(i)))).append('
    ').append(t)),a,1)},addSiblings:function(e,t){this.buildSiblingNode(e.closest("table"),t),e.closest(".nodes").data("siblingsLoaded",!0),e.children(".leftEdge").length||e.children(".topEdge").after(''),this.isInAction(e)&&(this.switchHorizontalArrow(e),e.children(".topEdge").removeClass("fa-chevron-up").addClass("fa-chevron-down"))},removeNodes:function(e){var t=e.closest("table").parent(),i=t.parent().siblings();t.is("td")?this.getNodeState(e,"siblings").exist?(i.eq(2).children(".topLine:lt(2)").remove(),i.slice(0,2).children().attr("colspan",i.eq(2).children().length),t.remove()):i.eq(0).children().removeAttr("colspan").find(".bottomEdge").remove().end().end().siblings().remove():t.add(t.siblings()).remove()},export:function(n,s){var a=this;if(n=void 0!==n?n:this.options.exportFilename,s=void 0!==s?s:this.options.exportFileextension,e(this).children(".spinner").length)return!1;var o=this.$chartContainer,d=o.find(".mask");d.length?d.removeClass("hidden"):o.append('
    ');var r=o.addClass("canvasContainer").find('.orgchart:not(".hidden")').get(0),l="l2r"===a.options.direction||"r2l"===a.options.direction;html2canvas(r,{width:l?r.clientHeight:r.clientWidth,height:l?r.clientWidth:r.clientHeight,onclone:function(t){e(t).find(".canvasContainer").css("overflow","visible").find('.orgchart:not(".hidden"):first').css("transform","")},onrendered:function(e){if(o.find(".mask").addClass("hidden"),"pdf"===s.toLowerCase()){var d={},r=Math.floor(.2646*e.width),l=Math.floor(.2646*e.height);(d=r>l?new jsPDF("l","mm",[r,l]):new jsPDF("p","mm",[l,r])).addImage(e.toDataURL(),"png",0,0),d.save(n+".pdf")}else{var h="WebkitAppearance"in i.documentElement.style,c=!!t.sidebar,g="Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&navigator.appVersion.indexOf("Edge")>-1;if(!h&&!c||g)t.navigator.msSaveBlob(e.msToBlob(),n+".png");else{var p=".oc-download-btn"+(""!==a.options.chartClass?"."+a.options.chartClass:"");o.find(p).length||o.append(''),o.find(p).attr("href",e.toDataURL())[0].click()}}}}).then(function(){o.removeClass("canvasContainer")},function(){o.removeClass("canvasContainer")})}},e.fn.orgchart=function(e){return new s(this,e).init()}}); +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxdWVyeS5vcmdjaGFydC5qcyJdLCJuYW1lcyI6WyJmYWN0b3J5IiwibW9kdWxlIiwiZXhwb3J0cyIsInJlcXVpcmUiLCJ3aW5kb3ciLCJkb2N1bWVudCIsImpRdWVyeSIsIiQiLCJ1bmRlZmluZWQiLCJPcmdDaGFydCIsImVsZW0iLCJvcHRzIiwidGhpcyIsIiRjaGFydENvbnRhaW5lciIsImRlZmF1bHRPcHRpb25zIiwibm9kZVRpdGxlIiwibm9kZUlkIiwidG9nZ2xlU2libGluZ3NSZXNwIiwidmlzaWJsZUxldmVsIiwiY2hhcnRDbGFzcyIsImV4cG9ydEJ1dHRvbiIsImV4cG9ydEZpbGVuYW1lIiwiZXhwb3J0RmlsZWV4dGVuc2lvbiIsInBhcmVudE5vZGVTeW1ib2wiLCJkcmFnZ2FibGUiLCJkaXJlY3Rpb24iLCJwYW4iLC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1idG4nICsgKHRoaXMub3B0aW9ucy5jaGFydENsYXNzICE9PSAnJyA/ICcgJyArIHRoaXMub3B0aW9ucy5jaGFydENsYXNzIDogJycpLFxuICAgICAgICAndGV4dCc6ICdFeHBvcnQnLFxuICAgICAgICAnY2xpY2snOiBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgIHRoYXQuZXhwb3J0KCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgICAgdGhpcy4kY2hhcnRDb250YWluZXIuYXBwZW5kKCRleHBvcnRCdG4pO1xuICAgIH0sXG4gICAgc2V0T3B0aW9uczogZnVuY3Rpb24gKG9wdHMsIHZhbCkge1xuICAgICAgaWYgKHR5cGVvZiBvcHRzID09PSAnc3RyaW5nJykge1xuICAgICAgICBpZiAob3B0cyA9PT0gJ3BhbicpIHtcbiAgICAgICAgICBpZiAodmFsKSB7XG4gICAgICAgICAgICB0aGlzLmJpbmRQYW4oKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy51bmJpbmRQYW4oKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdHMgPT09ICd6b29tJykge1xuICAgICAgICAgIGlmICh2YWwpIHtcbiAgICAgICAgICAgIHRoaXMuYmluZFpvb20oKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy51bmJpbmRab29tKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAodHlwZW9mIG9wdHMgPT09ICdvYmplY3QnKSB7XG4gICAgICAgIGlmIChvcHRzLmRhdGEpIHtcbiAgICAgICAgICB0aGlzLmluaXQob3B0cyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBvcHRzLnBhbiAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChvcHRzLnBhbikge1xuICAgICAgICAgICAgICB0aGlzLmJpbmRQYW4oKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMudW5iaW5kUGFuKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh0eXBlb2Ygb3B0cy56b29tICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKG9wdHMuem9vbSkge1xuICAgICAgICAgICAgICB0aGlzLmJpbmRab29tKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLnVuYmluZFpvb20oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfSxcbiAgICAvL1xuICAgIHBhblN0YXJ0SGFuZGxlcjogZnVuY3Rpb24gKGUpIHtcbiAgICAgIHZhciAkY2hhcnQgPSAkKGUuZGVsZWdhdGVUYXJnZXQpO1xuICAgICAgaWYgKCQoZS50YXJnZXQpLmNsb3Nlc3QoJy5ub2RlJykubGVuZ3RoIHx8IChlLnRvdWNoZXMgJiYgZS50b3VjaGVzLmxlbmd0aCA+IDEpKSB7XG4gICAgICAgICRjaGFydC5kYXRhKCdwYW5uaW5nJywgZmFsc2UpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAkY2hhcnQuY3NzKCdjdXJzb3InLCAnbW92ZScpLmRhdGEoJ3Bhbm5pbmcnLCB0cnVlKTtcbiAgICAgIH1cbiAgICAgIHZhciBsYXN0WCA9IDA7XG4gICAgICB2YXIgbGFzdFkgPSAwO1xuICAgICAgdmFyIGxhc3RUZiA9ICRjaGFydC5jc3MoJ3RyYW5zZm9ybScpO1xuICAgICAgaWYgKGxhc3RUZiAhPT0gJ25vbmUnKSB7XG4gICAgICAgIHZhciB0ZW1wID0gbGFzdFRmLnNwbGl0KCcsJyk7XG4gICA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k7XG4gICAgICAgICAgdmFyICRuZXh0U2liID0gJG5vZGUuY2xvc2VzdCgndGFibGUnKS5wYXJlbnQoKS5uZXh0KCk7XG4gICAgICAgICAgaWYgKCRoRWRnZS5pcygnLmxlZnRFZGdlJykpIHtcbiAgICAgICAgICAgIGlmICgkcHJldlNpYi5pcygnLmhpZGRlbicpKSB7XG4gICAgICAgICAgICAgIHRoaXMuc2hvd1NpYmxpbmdzKCRub2RlLCAnbGVmdCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy5oaWRlU2libGluZ3MoJG5vZGUsICdsZWZ0Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICgkbmV4dFNpYi5pcygnLmhpZGRlbicpKSB7XG4gICAgICAgICAgICAgIHRoaXMuc2hvd1NpYmxpbmdzKCRub2RlLCAncmlnaHQnKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuaGlkZVNpYmxpbmdzKCRub2RlLCAncmlnaHQnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHNpYmxpbmdzU3RhdGUudmlzaWJsZSkge1xuICAgICAgICAgICAgdGhpcy5oaWRlU2libGluZ3MoJG5vZGUpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnNob3dTaWJsaW5ncygkbm9kZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBsb2FkIHRoZSBuZXcgc2libGluZyBub2RlcyBvZiB0aGUgc3BlY2lmaWVkIG5vZGUgYnkgYWpheCByZXF1ZXN0XG4gICAgICAgIGlmICh0aGlzLnN0YXJ0TG9hZGluZygkaEVkZ2UpKSB7XG4gICAgICAgICAgdmFyIG5vZGVJZCA9ICRub2RlWzBdLmlkO1x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xuICAgICAgdGhpcy50b3VjaEhhbmRsZWQgPSBmYWxzZTtcbiAgICB9LFxuICAgIC8vIHNpbXVsYXRlIGEgbW91c2UgZXZlbnQgKHNvIHdlIGNhbiBmYWtlIHRoZW0gb24gYSB0b3VjaCBkZXZpY2UpXG4gICAgc2ltdWxhdGVNb3VzZUV2ZW50OiBmdW5jdGlvbiAoZXZlbnQsIHNpbXVsYXRlZFR5cGUpIHtcbiAgICAgIC8vIElnbm9yZSBtdWx0aS10b3VjaCBldmVudHNcbiAgICAgIGlmIChldmVudC5vcmlnaW5hbEV2ZW50LnRvdWNoZXMubGVuZ3RoID4gMSkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICB2YXIgdG91Y2ggPSBldmVudC5vcmlnaW5hbEV2ZW50LmNoYW5nZWRUb3VjaGVzWzBdO1xuICAgICAgdmFyIHNpbXVsYXRlZEV2ZW50ID0gZG9jdW1lbnQuY3JlYXRlRXZlbnQoJ01vdXNlRXZlbnRzJyk7XG4gICAgICBzaW11bGF0ZWRFdmVudC5pbml0TW91c2VFdmVudChcbiAgICAgICAgc2ltdWxhdGVkVHlwZSwgICAgLy8gdHlwZVxuICAgICAgICB0cnVlLCAgICAgICAgICAgICAvLyBidWJibGVzICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgdHJ1ZSwgICAgICAgICAgICAgLy8gY2FuY2VsYWJsZSAgICAgICAgICAgICAgICAgXG4gICAgICAgIHdpbmRvdywgICAgICAgICAgIC8vIHZpZXcgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAxLCAgICAgICAgICAgICAgICAvLyBkZXRhaWwgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgdG91Y2guc2NyZWVuWCwgICAgLy8gc2NyZWVuWCAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIHRvdWNoLnNjcmVlblksICAgIC8vIHNjcmVlblkgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICB0b3VjaC5jbGllbnRYLCAgICAvLyBjbGllbnRYICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgdG91Y2guY2xpZW50WSwgICAgLy8gY2xpZW50WSAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIGZhbHNlLCAgICAgICAgICAgIC8vIGN0cmxLZXkgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICBmYWxzZSwgICAgICAgICAgICAvLyBhbHRLZXkgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgZmFsc2UsICAgICAgICAgICAgLy8gc2hpZnRLZXkgICAgICAgICAgICAgICAgICAgXG4gICAgICAgIGZhbHNlLCAgICAgICAgICAgIC8vIG1ldGFLZXkgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAwLCAgICAgICAgICAgICAgICAvLyBidXR0b24gICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgbnVsbCAgICAgICAgICAgICAgLy8gcmVsYXRlZFRhcmdldCAgICAgICAgICAgICAgXG4gICAgICApO1xuICAgICAgLy8gRGlzcGF0Y2ggdGhlIHNpbXVsYXRlZCBldmVudCB0byB0aGUgdGFyZ2V0IGVsZW1lbnRcbiAgICAgIGV2ZW50LnRhcmdldC5kaXNwYXRjaEV2ZW50KHNpbXVsYXRlZEV2ZW50KTtcbiAgICB9LFxuICAgIC8vXG4gICAgYmluZERyYWdEcm9wOiBmdW5jdGlvbiAoJG5vZGUpIHtcbiAgICAgICRub2RlLm9uKCdkcmFnc3RhcnQnLCB0aGlzLmRyYWdzdGFydEhhbmRsZXIuYmluZCh0aGlzKSlcbiAgICAgICAgLm9uKCdkcmFnb3ZlcicsIHRoaXMuZHJhZ292ZXJIYW5kbGVyLmJpbmQodGhpcykpXG4gICAgICAgIC5vbignZHJhZ2VuZCcsIHRoaXMuZHJhZ2VuZEhhbmRsZXIuYmluZCh0aGlzKSlcbiAgICAgICAgLm9uKCdkcm9wJywgdGhpcy5kcm9wSGFuZGxlci5iaW5kKHRoaXMpKVxuICAgICAgICAub24oJ3RvdWNoc3RhcnQnL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3J0RmlsZW5hbWUgKyAnLnBuZ1wiPjwvYT4nKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAkY2hhcnRDb250YWluZXIuZmluZChzZWxlY3RvcikuYXR0cignaHJlZicsIGNhbnZhcy50b0RhdGFVUkwoKSlbMF0uY2xpY2soKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgICAudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICRjaGFydENvbnRhaW5lci5yZW1vdmVDbGFzcygnY2FudmFzQ29udGFpbmVyJyk7XG4gICAgICB9LCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICRjaGFydENvbnRhaW5lci5yZW1vdmVDbGFzcygnY2FudmFzQ29udGFpbmVyJyk7XG4gICAgICB9KTtcbiAgICB9XG4gIH07XG5cbiAgJC5mbi5vcmdjaGFydCA9IGZ1bmN0aW9uIChvcHRzKSB7XG4gICAgcmV0dXJuIG5ldyBPcmdDaGFydCh0aGlzLCBvcHRzKS5pbml0KCk7XG4gIH07XG5cbn0pKTtcbiJdfQ== diff --git a/package.json b/package.json index 1e50c755..b4ca984e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orgchart", - "version": "2.0.15", + "version": "2.1.0", "description": "Simple and direct organization chart(tree-like hierarchy) plugin based on pure DOM and jQuery.", "main": "./dist/js/jquery.orgchart.min.js", "style": [