fix a bug in map where the input element would not change its style when there are no results
This commit is contained in:
parent
f9143bd62f
commit
3fa654a815
2 changed files with 15 additions and 13 deletions
|
@ -1289,19 +1289,21 @@ Ox.List = function(options, self) {
|
|||
//Ox.print('INIT!!!', result.data)
|
||||
that.triggerEvent('init', result.data);
|
||||
self.rowLength = getRowLength();
|
||||
self.pageLength = self.options.orientation == 'both' ?
|
||||
self.pageLengthByRowLength[self.rowLength] :
|
||||
self.options.pageLength;
|
||||
self.pageLength = self.options.orientation == 'both'
|
||||
? self.pageLengthByRowLength[self.rowLength]
|
||||
: self.options.pageLength;
|
||||
Ox.extend(self, {
|
||||
listLength: result.data.items,
|
||||
pages: Math.max(Math.ceil(result.data.items / self.pageLength), 1),
|
||||
pageWidth: self.options.orientation == 'vertical' ? 0 :
|
||||
(self.options.itemWidth + self.itemMargin) *
|
||||
(self.options.orientation == 'horizontal' ?
|
||||
self.pageLength : self.rowLength),
|
||||
pageHeight: self.options.orientation == 'horizontal' ? 0 :
|
||||
Math.ceil(self.pageLength * (self.options.itemHeight +
|
||||
self.itemMargin) / self.rowLength)
|
||||
pageWidth: self.options.orientation == 'vertical'
|
||||
? 0 : (self.options.itemWidth + self.itemMargin) * (
|
||||
self.options.orientation == 'horizontal'
|
||||
? self.pageLength : self.rowLength
|
||||
),
|
||||
pageHeight: self.options.orientation == 'horizontal'
|
||||
? 0 : Math.ceil(self.pageLength * (
|
||||
self.options.itemHeight + self.itemMargin
|
||||
) / self.rowLength)
|
||||
});
|
||||
self.listSize = getListSize();
|
||||
that.$content.css(
|
||||
|
|
|
@ -647,8 +647,8 @@ Ox.Map = function(options, self) {
|
|||
callback(new Ox.MapPlace(parseGeodata(results[0])));
|
||||
}
|
||||
if (
|
||||
status == google.maps.GeocoderStatus.OK ||
|
||||
status == google.maps.GeocoderStatus.ZERO_RESULTS
|
||||
status == google.maps.GeocoderStatus.OK
|
||||
&& status != google.maps.GeocoderStatus.ZERO_RESULTS
|
||||
) {
|
||||
triggerGeocodeEvent({
|
||||
address: name,
|
||||
|
@ -1262,7 +1262,7 @@ Ox.Map = function(options, self) {
|
|||
addPlaceToMap(place);
|
||||
self.map.fitBounds(place.bounds);
|
||||
} else {
|
||||
self.$findInput.addClass('OxError');
|
||||
name && self.$findInput.addClass('OxError');
|
||||
}
|
||||
callback(place);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue