Browse files

Simplifying.

  • Loading branch information...
1 parent b0f3ffc commit d4ea119d23b0956be15c9138fb8c739f3861ab74 @juliamae juliamae committed Nov 28, 2010
Showing with 4 additions and 7 deletions.
  1. +1 −1 demo/ui.demo.html
  2. +3 −6 ui.geo_autocomplete.js
View
2 demo/ui.demo.html
@@ -77,7 +77,7 @@
// Example callback on select item from autocomplete list
select: function(_event, _ui) {
- if (typeof _ui.item.viewport.getCenter == "function") {
+ if ( _ui.item.viewport ) {
var lat = _ui.item.viewport.getCenter().lat();
var lng = _ui.item.viewport.getCenter().lng();
View
9 ui.geo_autocomplete.js
@@ -103,11 +103,8 @@ $.widget( "ui.geo_autocomplete", {
});
if (self.options.pinDrop) {
- // Drop a pin option
- row = ['Drop a pin', null];
_parsed.push({
- viewport: row,
- value: row[0],
+ value: 'Drop a pin',
label: _request.term
});
}
@@ -120,7 +117,7 @@ $.widget( "ui.geo_autocomplete", {
// returns the HTML used for each autocomplete list item
getItemHTML: function(_item) {
- if (typeof _item.viewport.getSouthWest != "undefined") {
+ if ( _item.viewport ) {
var _src = 'http://maps.google.com/maps/api/staticmap?visible=' +
_item.viewport.getSouthWest().toUrlValue() + '|' +
_item.viewport.getNorthEast().toUrlValue() + '&size=' + this.mapwidth +
@@ -137,7 +134,7 @@ $.widget( "ui.geo_autocomplete", {
// handler for click on results
pinDropSelect: function(_event, _ui) {
- if ( this.map && typeof _ui.item.viewport.getSouthWest != "function" ){
+ if ( this.map && !_ui.item.viewport ){
var self = this;
// Add a click listener which displays the marker to the map

0 comments on commit d4ea119

Please sign in to comment.