update countries example
This commit is contained in:
parent
b5749bfaeb
commit
3687620814
1 changed files with 14 additions and 14 deletions
|
@ -265,18 +265,18 @@ Ox.load(['Geo', 'UI'], function() {
|
|||
function renderItem() {
|
||||
var code = ui.selected[0];
|
||||
$item.empty();
|
||||
if (ui.view == 'grid') {
|
||||
Ox.TreeList({
|
||||
if (code) {
|
||||
$item.append(
|
||||
ui.view == 'grid'
|
||||
? Ox.TreeList({
|
||||
data: Ox.getCountryByCode(code),
|
||||
scrollbarVisible: true,
|
||||
width: itemSize
|
||||
})
|
||||
.appendTo($item);
|
||||
} else {
|
||||
Ox.Element('<img>')
|
||||
: Ox.Element('<img>')
|
||||
.addClass('flag')
|
||||
.attr({src: Ox.getFlagByCountryCode(code, 256)})
|
||||
.appendTo($item);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in a new issue