1
0
Fork 0
forked from 0x2620/oxjs

form elements rewrite, part 2

This commit is contained in:
rolux 2011-12-21 21:03:52 +05:30
commit 074902d079
33 changed files with 163 additions and 153 deletions

View file

@ -234,7 +234,7 @@ Ox.ListMap = function(options, self) {
})
.bindEvent({
change: function(data) {
var key = data.selected[0].id,
var key = data.value,
value = self.$findInput.value();
value && updateList(key, value);
}
@ -324,7 +324,7 @@ Ox.ListMap = function(options, self) {
*/
changeplace: function(data) {
self.$placeForm.values(data).show();
self.$areaKmInput.options({value: Ox.formatArea(data.area)});
self.$areaKmInput.value(Ox.formatArea(data.area));
},
changeplaceend: function(data) {
//Ox.Log('Map', 'ssP', self.selectedPlace);
@ -470,7 +470,7 @@ Ox.ListMap = function(options, self) {
{id: 'borough', title: 'Borough'},
{id: 'street', title: 'Street'}, // streets, squares, bridges, tunnels, ...
{id: 'building', title: 'Building'}, // airports, stations, stadiums, military installations, ...
{id: 'feature', title: 'Feature'} // continents, islands, rivers, lakes, seas, oceans, ...
{id: 'feature', title: 'Feature'} // continents, islands, rivers, lakes, seas, oceans, mountains...
],
label: 'Type',
labelWidth: 64,
@ -483,7 +483,7 @@ Ox.ListMap = function(options, self) {
} else {
!isResult && editPlace(['type'])
}
self.$map.value(self.selectedPlace, 'type', data.selected[0].id);
self.$map.value(self.selectedPlace, 'type', data.value);
}
})
], ['Latitude', 'Longitude', 'South', 'West', 'North', 'East'].map(function(v) {
@ -805,7 +805,7 @@ Ox.ListMap = function(options, self) {
});
self.$placeName.options({title: place.geoname || ''});
self.$placeTitle.show();
self.$areaKmInput.options({value: Ox.formatArea(place.area)});
self.$areaKmInput.value(Ox.formatArea(place.area));
self.$placeForm.values(place).show();
self.$placeButton.options({title: isResult ? 'Add Place' : 'Remove Place'}).show();
updateMatches();
@ -850,12 +850,12 @@ Ox.ListMap = function(options, self) {
return name !== '';
});
if (names.length) {
self.$matchesInput.options({value: ''});
self.$matchesInput.value('');
self.options.getMatches(names, function(matches) {
self.$matchesInput.options({value: Ox.formatNumber(matches)});
self.$matchesInput.value(Ox.formatNumber(matches));
});
} else {
self.$matchesInput.options({value: 0});
self.$matchesInput.value(0);
}
}
}