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

View file

@ -575,6 +575,7 @@ Ox.Map = function(options, self) {
self.$zoomInput && self.$zoomInput.remove();
self.$zoomInput = Ox.Range({
arrows: true,
changeOnDrag: true,
max: self.maxZoom,
min: self.minZoom,
size: that.width(),
@ -817,7 +818,7 @@ Ox.Map = function(options, self) {
that.overlayView.draw();
if (self.options.find) {
self.$findInput.options({value: self.options.find})
self.$findInput.value(self.options.find)
.triggerEvent('submit', {value: self.options.find});
} else if (self.options.selected) {
selectPlace(self.options.selected, true);
@ -906,7 +907,6 @@ Ox.Map = function(options, self) {
}
});
} else {
Ox.print ('sG cD', spansGlobe(), crossesDateline())
self.options.places({
keys: self.placeKeys,
query: {
@ -1363,7 +1363,7 @@ Ox.Map = function(options, self) {
self.map.setZoom(self.maxZoom);
} else {
self.zoomChanged = true;
self.$zoomInput && self.$zoomInput.options({value: zoom});
self.$zoomInput && self.$zoomInput.value(zoom);
that.triggerEvent('zoom', {
value: zoom
});