blob: 64b711ff209da22a1641b0676ad4b4c9b3e8533e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php defined("SYSPATH") or die("No direct script access."); ?>
<? if ($root): ?>
<script>
var simpleTree_Rearrange;
$(document).ready(function() {
simpleTree_Rearrange = $(".simpleTree").simpleTree({
autoclose: false,
animate: true,
afterClick:function(node) {
alert("text-"+$('span:first', node).text());
},
afterDblClick:function(node) {
alert("text-"+$('span:first', node).text());
},
afterMove:function(destination, source, pos) {
alert("destination: "+destination.attr('id') + "\n" +
"source: "+source.attr('id') + "\n" +
"pos: " + pos);
},
afterAjax:function() {
}
});
});
</script>
<ul class="simpleTree">
<li class="root" id="<?= $root->id?>"><span><?= $root->title?></span>
<? endif; ?>
<ul>
<? foreach ($children as $child): ?>
<li id="<?= $child->id?>"><span class="text"><?= $child->title?></span>
<? if ($child->type == "album"): ?>
<ul class="ajax">
<li><?= url::site("rearrange/$child->id") ?></li>
</ul>
<? endif; ?>
</li>
<? endforeach;?>
</ul>
<? if ($root): ?>
</li>
</ul>
<? endif; ?>
|