forked from 0x2620/oxjs
fixing a bug where in a list, the click target loop would not exit when items are added or removed on click
This commit is contained in:
parent
5efe54c0e2
commit
c3b59a62fe
8 changed files with 71 additions and 22 deletions
|
|
@ -3,7 +3,7 @@ Ox.load('UI', {
|
|||
theme: 'classic'
|
||||
}, function() {
|
||||
Ox.Theme('classic');
|
||||
$.getJSON(Ox.UI.PATH + 'json/Ox.UI.json', function(files) {
|
||||
$.getJSON(Ox.UI.PATH + 'json/Ox.UI.files.json', function(files) {
|
||||
doc = Ox.DocPanel({
|
||||
files: Ox.merge([
|
||||
'Ox.js',
|
||||
|
|
@ -25,8 +25,9 @@ Ox.load('UI', {
|
|||
doc.selectItem(document.location.hash.substring(1));
|
||||
},
|
||||
select: function(data) {
|
||||
if(data.ids)
|
||||
if (data.ids) {
|
||||
document.location.hash = data.ids[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
doc.appendTo(Ox.UI.$body);
|
||||
|
|
|
|||
10
demos/treelist/index.html
Normal file
10
demos/treelist/index.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>OxJS TreeList Demo</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<script type="text/javascript" src="../../build/Ox.js"></script>
|
||||
<script type="text/javascript" src="js/treelist.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
36
demos/treelist/js/treelist.js
Normal file
36
demos/treelist/js/treelist.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
Ox.load('UI', {debug: true}, function() {
|
||||
|
||||
Ox.load('Geo', function() {
|
||||
|
||||
var $treeList = new Ox.TreeList({
|
||||
data: {'Ox.COUNTRIES': Ox.COUNTRIES}
|
||||
}),
|
||||
$debug = new Ox.Element('div'),
|
||||
$button = new Ox.Button({
|
||||
title: 'Debug'
|
||||
})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
$text.html(JSON.stringify($treeList.$element.options('items')))
|
||||
}
|
||||
})
|
||||
.appendTo($debug),
|
||||
$text = new Ox.Element('div').appendTo($debug),
|
||||
$splitPanel = new Ox.SplitPanel({
|
||||
elements: [
|
||||
{
|
||||
element: $treeList,
|
||||
size: 256,
|
||||
resizable: true,
|
||||
resize: [128, 256, 384]
|
||||
},
|
||||
{
|
||||
element: $debug
|
||||
}
|
||||
],
|
||||
orientation: 'horizontal'
|
||||
}).appendTo($('body'));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue