panel that shows underlying html list now updates when node elements are rearranged
parent
b39c765332
commit
beba805557
|
@ -20,21 +20,6 @@
|
|||
chartElement : '#chart',
|
||||
dragAndDrop : true
|
||||
});
|
||||
|
||||
/* Extra Code */
|
||||
$("#show-list").click(function(e){
|
||||
e.preventDefault();
|
||||
|
||||
$('#list-html').toggle('fast', function(){
|
||||
if($(this).is(':visible')){
|
||||
$('#show-list').text('Hide underlying list.');
|
||||
$(".topbar").fadeTo('fast',0.9);
|
||||
}else{
|
||||
$('#show-list').text('Show underlying list.');
|
||||
$(".topbar").fadeTo('fast',1);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
@ -52,46 +37,7 @@
|
|||
<div class="pull-right">
|
||||
<div class="alert-message info" id="show-list">Show underlying list.</div>
|
||||
|
||||
<pre class="prettyprint lang-html" id="list-html" style="display:none"><ul id="org" style="display:none">
|
||||
<li>
|
||||
Food
|
||||
<ul>
|
||||
<li>Beer</li>
|
||||
<li>Vegetables
|
||||
<ul>
|
||||
<li>Pumpkin</li>
|
||||
<li>
|
||||
<a href="http://tquila.com" target="_blank">Aubergine</a>
|
||||
<p>A link and paragraph is all we need.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Fruit
|
||||
<ul>
|
||||
<li>Apple
|
||||
<ul>
|
||||
<li>Granny Smith</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Berries
|
||||
<ul>
|
||||
<li>Blueberry</li>
|
||||
<li><img src="images/raspberry.jpg" alt="Raspberry"/></li>
|
||||
<li>Cucumber</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Bread</li>
|
||||
<li>Chocolate
|
||||
<ul>
|
||||
<li>Topdeck</li>
|
||||
<li>Reese's Cups</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul></pre>
|
||||
<pre class="prettyprint lang-html" id="list-html" style="display:none"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -140,4 +86,35 @@
|
|||
|
||||
<div id="chart" class="orgChart"></div>
|
||||
|
||||
</body></html>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/* Custom jQuery for the example */
|
||||
$("#show-list").click(function(e){
|
||||
e.preventDefault();
|
||||
|
||||
$('#list-html').toggle('fast', function(){
|
||||
if($(this).is(':visible')){
|
||||
$('#show-list').text('Hide underlying list.');
|
||||
$(".topbar").fadeTo('fast',0.9);
|
||||
}else{
|
||||
$('#show-list').text('Show underlying list.');
|
||||
$(".topbar").fadeTo('fast',1);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#list-html').text($('#org').html());
|
||||
|
||||
$("#org").bind("DOMSubtreeModified", function() {
|
||||
$('#list-html').text('');
|
||||
|
||||
$('#list-html').text($('#org').html());
|
||||
|
||||
prettyPrint();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue