geocomplete_rails 1.4.1.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OWIyMTc0ZmU5YzJmZWJiYjAzYTM3Y2ZkYWZiMzlmODJjYjJhNjg0MQ==
5
- data.tar.gz: !binary |-
6
- MzJjMjUyN2ZlYjNlOGFkZmRlMzIwZjM5MWNmZWE2MzQ1NDUzMzk2MA==
2
+ SHA1:
3
+ metadata.gz: 743debf105efd2d7793ef00157ea1b72a37506f1
4
+ data.tar.gz: 74a4a27954fe36740330411739a1e7a814a9ab4f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmFiZjM2NTcyODQ3NDI1NjVkNmY0M2RjOGJmZGQ0MGQwNDhjYWI2ZDE5ZjAx
10
- YTA2NWRjMDA2NmM3N2Y3YWI2ODdlM2Q3NDVkYjE5ZTZmNTZjZGQ0MDJhN2Mw
11
- ODlkY2M2ZWM4OTFkZDFhODg5NDFkMzgzY2E3MTk5Zjg2MjM4ZGE=
12
- data.tar.gz: !binary |-
13
- Yzg3YzI4ZDYyZjc2NGMzYzFkNzBhY2ZjN2UzZjY2M2I3MjA3YWU3OTE5M2Q0
14
- YzgzZGY4MDE1ZWQ1NjJhYTJiNjNiZWUzNGY0ZTY5Y2JmNGM2MTFjMzlhMzAx
15
- ZjRjZTE2ODIzMGI0M2ZmNDQ2NDRjNDI4MzI5ZWQ1OWMyNDNlMjI=
6
+ metadata.gz: 48539cb76d70373efcddd5e752f31e5882f2fc406e71d3f3e56b0b426bf678d9f02f96086cb0af88d2365a9d3ffa5d38fbb6299ca33c14f5364884972bad5cf2
7
+ data.tar.gz: 648ff0c3fd6930212a103497f617ff281594f473b42dee41901d85fa2621779cab025bcf825dd304c242abef753b546f42f848c5e1e61edb83a39f20d0b9feb6
@@ -1,5 +1,5 @@
1
1
  /**
2
- * jQuery Geocoding and Places Autocomplete Plugin - V 1.4.1
2
+ * jQuery Geocoding and Places Autocomplete Plugin - V 1.5.0
3
3
  *
4
4
  * @author Martin Kleppe <kleppe@ubilabs.net>, 2012
5
5
  * @author Ubilabs http://ubilabs.net, 2012
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  // # $.geocomplete()
10
- // ## jQuery Geocoding and Places Autocomplete Plugin - V 1.4.1
10
+ // ## jQuery Geocoding and Places Autocomplete Plugin - V 1.5.0
11
11
  //
12
12
  // * https://github.com/ubilabs/geocomplete/
13
13
  // * by Martin Kleppe <kleppe@ubilabs.net>
@@ -21,6 +21,7 @@
21
21
  // * `details` - The container that should be populated with data. Defaults to `false` which ignores the setting.
22
22
  // * `location` - Location to initialize the map on. Might be an address `string` or an `array` with [latitude, longitude] or a `google.maps.LatLng`object. Default is `false` which shows a blank map.
23
23
  // * `bounds` - Whether to snap geocode search to map bounds. Default: `true` if false search globally. Alternatively pass a custom `LatLngBounds object.
24
+ // * `autoselect` - Automatically selects the highlighted item or the first item from the suggestions list on Enter.
24
25
  // * `detailsAttribute` - The attribute's name to use as an indicator. Default: `"name"`
25
26
  // * `mapOptions` - Options to pass to the `google.maps.Map` constructor. See the full list [here](http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions).
26
27
  // * `mapOptions.zoom` - The inital zoom level. Default: `14`
@@ -38,6 +39,7 @@
38
39
  map: false,
39
40
  details: false,
40
41
  detailsAttribute: "name",
42
+ autoselect: true,
41
43
  location: false,
42
44
 
43
45
  mapOptions: {
@@ -116,6 +118,12 @@
116
118
  'click',
117
119
  $.proxy(this.mapClicked, this)
118
120
  );
121
+
122
+ google.maps.event.addListener(
123
+ this.map,
124
+ 'zoom_changed',
125
+ $.proxy(this.mapZoomed, this)
126
+ );
119
127
  },
120
128
 
121
129
  // Add a marker with the provided `markerOptions` but only
@@ -423,6 +431,10 @@
423
431
  this.trigger("geocode:click", event.latLng);
424
432
  },
425
433
 
434
+ mapZoomed: function(event) {
435
+ this.trigger("geocode:zoom", this.map.getZoom());
436
+ },
437
+
426
438
  // Restore the old position of the marker to the last now location.
427
439
  resetMarker: function(){
428
440
  this.marker.setPosition(this.data.location);
@@ -436,10 +448,12 @@
436
448
  var place = this.autocomplete.getPlace();
437
449
 
438
450
  if (!place.geometry){
439
- // Automatically selects the highlighted item or the first item from the
440
- // suggestions list.
441
- var autoSelection = this.selectFirstResult();
442
- this.find(autoSelection);
451
+ if (this.options.autoselect) {
452
+ // Automatically selects the highlighted item or the first item from the
453
+ // suggestions list.
454
+ var autoSelection = this.selectFirstResult();
455
+ this.find(autoSelection);
456
+ }
443
457
  } else {
444
458
  // Use the input text if it already gives geometry.
445
459
  this.update(place);
@@ -1,3 +1,3 @@
1
1
  module GeocompleteRails
2
- VERSION = "1.4.1.1"
2
+ VERSION = "1.5.0"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geocomplete_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guy Israeli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-04 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: railties
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.1'
55
55
  description: Wrapper for geocomplete.js - a jQuery Geocoding and Places Autocomplete
@@ -59,7 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
62
+ - ".gitignore"
63
63
  - Gemfile
64
64
  - LICENSE.txt
65
65
  - README.md
@@ -78,17 +78,17 @@ require_paths:
78
78
  - lib
79
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ! '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ! '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.1.3
91
+ rubygems_version: 2.2.1
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: jQuery Geocoding and Places Autocomplete Plugin