update cities example

This commit is contained in:
rolux 2012-06-19 19:32:47 +02:00
parent e1bd7d0cb3
commit 5fb5198008

View file

@ -101,12 +101,7 @@ Ox.load({UI: {showScreen: true}, Geo: {}}, function() {
);
*/
var listAPI = Ox.api(cities, {
cache: true,
sort: ['-population', '+name'],
sums: ['population']
}),
$preview = Ox.Button({
var $preview = Ox.Button({
disabled: true,
selectable: true,
title: 'view',
@ -127,8 +122,7 @@ Ox.load({UI: {showScreen: true}, Geo: {}}, function() {
})
.bindEvent({
submit: function(data) {
listAPI({
keys: [],
$list.options({
query: {
conditions: data.value ? [
{
@ -140,12 +134,15 @@ Ox.load({UI: {showScreen: true}, Geo: {}}, function() {
key: 'region',
operator: '=',
value: data.value
},
{
key: 'continent',
operator: '=',
value: data.value
}
] : [],
operator: '|'
}
}, function(result) {
$list.options({items: result.data.items});
});
}
}),
@ -495,9 +492,7 @@ Ox.load({UI: {showScreen: true}, Geo: {}}, function() {
},
{
element: $map.bindEvent({
resizeend: function(data) {
$map.resizeMap();
}
resizeend: $map.resizeMap
})
}
],
@ -512,11 +507,7 @@ Ox.load({UI: {showScreen: true}, Geo: {}}, function() {
});
}
Ox.$window.bind({
resize: function() {
$map.resizeMap();
}
});
Ox.$window.bind({resize: $map.resizeMap});
});