1
0
Fork 0
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:
rlx 2011-09-05 05:40:44 +00:00
commit c3b59a62fe
8 changed files with 71 additions and 22 deletions

View file

@ -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
View 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>

View 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'));
});
});