fix a bug in map where the input element would not change its style when there are no results

This commit is contained in:
rlx 2011-10-01 13:51:03 +00:00
parent f9143bd62f
commit 3fa654a815
2 changed files with 15 additions and 13 deletions

View file

@ -1289,19 +1289,21 @@ Ox.List = function(options, self) {
//Ox.print('INIT!!!', result.data) //Ox.print('INIT!!!', result.data)
that.triggerEvent('init', result.data); that.triggerEvent('init', result.data);
self.rowLength = getRowLength(); self.rowLength = getRowLength();
self.pageLength = self.options.orientation == 'both' ? self.pageLength = self.options.orientation == 'both'
self.pageLengthByRowLength[self.rowLength] : ? self.pageLengthByRowLength[self.rowLength]
self.options.pageLength; : self.options.pageLength;
Ox.extend(self, { Ox.extend(self, {
listLength: result.data.items, listLength: result.data.items,
pages: Math.max(Math.ceil(result.data.items / self.pageLength), 1), pages: Math.max(Math.ceil(result.data.items / self.pageLength), 1),
pageWidth: self.options.orientation == 'vertical' ? 0 : pageWidth: self.options.orientation == 'vertical'
(self.options.itemWidth + self.itemMargin) * ? 0 : (self.options.itemWidth + self.itemMargin) * (
(self.options.orientation == 'horizontal' ? self.options.orientation == 'horizontal'
self.pageLength : self.rowLength), ? self.pageLength : self.rowLength
pageHeight: self.options.orientation == 'horizontal' ? 0 : ),
Math.ceil(self.pageLength * (self.options.itemHeight + pageHeight: self.options.orientation == 'horizontal'
self.itemMargin) / self.rowLength) ? 0 : Math.ceil(self.pageLength * (
self.options.itemHeight + self.itemMargin
) / self.rowLength)
}); });
self.listSize = getListSize(); self.listSize = getListSize();
that.$content.css( that.$content.css(

View file

@ -647,8 +647,8 @@ Ox.Map = function(options, self) {
callback(new Ox.MapPlace(parseGeodata(results[0]))); callback(new Ox.MapPlace(parseGeodata(results[0])));
} }
if ( if (
status == google.maps.GeocoderStatus.OK || status == google.maps.GeocoderStatus.OK
status == google.maps.GeocoderStatus.ZERO_RESULTS && status != google.maps.GeocoderStatus.ZERO_RESULTS
) { ) {
triggerGeocodeEvent({ triggerGeocodeEvent({
address: name, address: name,
@ -1262,7 +1262,7 @@ Ox.Map = function(options, self) {
addPlaceToMap(place); addPlaceToMap(place);
self.map.fitBounds(place.bounds); self.map.fitBounds(place.bounds);
} else { } else {
self.$findInput.addClass('OxError'); name && self.$findInput.addClass('OxError');
} }
callback(place); callback(place);
}); });