diff --git a/example/example.html b/example/example.html index b5bf5a4..08404f3 100644 --- a/example/example.html +++ b/example/example.html @@ -9,8 +9,8 @@ - - + + diff --git a/example/jquery.jOrgChart.js b/example/jquery.jOrgChart.js index ebb5873..1b97c02 100644 --- a/example/jquery.jOrgChart.js +++ b/example/jquery.jOrgChart.js @@ -35,44 +35,41 @@ $('div.node').draggable({ cursor : 'move', distance : 40, - helper : 'clone', + helper : 'clone', opacity : 0.8, - revert : true, + revert : true, revertDuration : 100, snap : 'div.node.expanded', snapMode : 'inner', - stack : 'div.node', - start : handleDragStart, - stop : handleDragStop + stack : 'div.node' }); $('div.node').droppable({ - accept : '.node', + accept : '.node', activeClass : 'drag-active', - drop : handleDropEvent, hoverClass : 'drop-hover' }); // Drag start event handler for nodes - function handleDragStart( event, ui ){ + $('div.node').bind("dragstart", function handleDragStart( event, ui ){ var sourceNode = $(this); sourceNode.parentsUntil('.node-container') .find('*') .filter('.node') .droppable('disable'); - } + }); // Drag stop event handler for nodes - function handleDragStop( event, ui ){ + $('div.node').bind("dragstop", function handleDragStop( event, ui ){ /* reload the plugin */ $(opts.chartElement).children().remove(); $this.jOrgChart(opts); - } + }); // Drop event handler for nodes - function handleDropEvent( event, ui ) { + $('div.node').bind("drop", function handleDropEvent( event, ui ) { var sourceNode = ui.draggable; var targetNode = $(this); @@ -113,7 +110,7 @@ targetLi.append('