update countries example

This commit is contained in:
rolux 2012-06-19 15:06:57 +02:00
parent b5749bfaeb
commit 3687620814

View file

@ -265,18 +265,18 @@ Ox.load(['Geo', 'UI'], function() {
function renderItem() {
var code = ui.selected[0];
$item.empty();
if (ui.view == 'grid') {
Ox.TreeList({
data: Ox.getCountryByCode(code),
scrollbarVisible: true,
width: itemSize
})
.appendTo($item);
} else {
Ox.Element('<img>')
.addClass('flag')
.attr({src: Ox.getFlagByCountryCode(code, 256)})
.appendTo($item);
if (code) {
$item.append(
ui.view == 'grid'
? Ox.TreeList({
data: Ox.getCountryByCode(code),
scrollbarVisible: true,
width: itemSize
})
: Ox.Element('<img>')
.addClass('flag')
.attr({src: Ox.getFlagByCountryCode(code, 256)})
);
}
}
@ -339,13 +339,12 @@ Ox.load(['Geo', 'UI'], function() {
data = $list.value(id);
$title.options({title: data.name}).show();
$deselect.show();
renderItem();
} else {
ui.selected = [];
$title.hide();
$deselect.hide();
$item.empty();
}
renderItem();
}
function sort(data) {
@ -368,6 +367,7 @@ Ox.load(['Geo', 'UI'], function() {
$list = renderList();
$listPanel.replaceElement(1, $list);
$list.gainFocus();
renderItem();
}
});