gmaps4rails 2.0.5 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d37c1adc6f0749181e2f7c73d237429ce20a842
4
- data.tar.gz: 8080428600979d11005c1917484aaf84a04c5d87
3
+ metadata.gz: c5258e3e4ac28ce4aee9b51391b51941f70107ab
4
+ data.tar.gz: f3226ab987085968259cd22c0667c4121e254ae7
5
5
  SHA512:
6
- metadata.gz: 83db60b9cb073df5902350e620b44c07ed66131d37893d7789ffb326aa0ac8aaad2fa63b68b418e7dc40fe50c6d64121a99c8bf41b8a43378b1b9d020d73b3da
7
- data.tar.gz: 88824d73a049af2fa8e8d458e6767326a7b57f4710017e662aeb7cf2be8a59339f6e50cf51ed562a082c59b3a3412730949f9f672611fc6ad66fdac2455c1792
6
+ metadata.gz: 4e5d0937d72dfab9bb75e534d8facc9df45e731df75b29129a65baff56af69f98c9ac04c5fb3a079ca40c3b6a0281db8cb335bc92bd6587deec1d3b502c44b57
7
+ data.tar.gz: 3d61f999c92e529e8ae4fe3ec53da86fd0ffc67854e256f178e13e0c42df29aa2ea458b78dca2135383ae6333fccbee78356c6e79b985ec126665e88ac72b80b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gmaps4rails (2.0.5)
4
+ gmaps4rails (2.1.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module Gmaps4rails
2
- VERSION = "2.0.5"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -42,8 +42,8 @@ describe("Gmaps.Google.Builders.Marker", function() {
42
42
  called_lat = primitives.latLng.mostRecentCall.args[0];
43
43
  called_lng = primitives.latLng.mostRecentCall.args[1];
44
44
 
45
- expect(called_lat).toBeWithinOf(args.lat, 0.0001);
46
- expect(called_lng).toBeWithinOf(args.lng, 0.0001);
45
+ expect(called_lat).toBeWithinOf(args.lat, 0.00011);
46
+ expect(called_lng).toBeWithinOf(args.lng, 0.00011);
47
47
  });
48
48
  });
49
49
 
@@ -26,19 +26,18 @@ class @Gmaps.Google.Builders.Marker extends Gmaps.Objects.BaseBuilder
26
26
  constructor: (@args, @provider_options = {}, @internal_options = {})->
27
27
  @before_init()
28
28
  @create_marker()
29
- @create_infowindow()
29
+ @create_infowindow_on_click()
30
30
  @after_init()
31
31
 
32
32
  build: ->
33
- new(@model_class())(@serviceObject, @infowindow)
33
+ @object = new(@model_class())(@serviceObject)
34
34
 
35
35
  create_marker: ->
36
36
  @serviceObject = new(@primitives().marker)(@marker_options())
37
37
 
38
38
  create_infowindow: ->
39
39
  return null unless _.isString @args.infowindow
40
- @infowindow = new(@primitives().infowindow)({content: @args.infowindow })
41
- @bind_infowindow()
40
+ new(@primitives().infowindow)({content: @args.infowindow })
42
41
 
43
42
  marker_options: ->
44
43
  coords = @_randomized_coordinates()
@@ -49,13 +48,18 @@ class @Gmaps.Google.Builders.Marker extends Gmaps.Objects.BaseBuilder
49
48
  shadow: @_get_picture('shadow')
50
49
  _.extend @provider_options, base_options
51
50
 
52
- bind_infowindow: ->
51
+ create_infowindow_on_click: ->
53
52
  @addListener 'click', @infowindow_binding
54
53
 
55
54
  infowindow_binding: =>
56
- @panTo()
57
55
  @constructor.CURRENT_INFOWINDOW.close() if @_should_close_infowindow()
56
+ @panTo()
57
+ @infowindow ?= @create_infowindow()
58
+
59
+ return unless @infowindow?
60
+
58
61
  @infowindow.open( @getServiceObject().getMap(), @getServiceObject())
62
+ @object.infowindow ?= @infowindow
59
63
  @constructor.CURRENT_INFOWINDOW = @infowindow
60
64
 
61
65
  panTo: ->
@@ -2,7 +2,8 @@ class @Gmaps.Google.Objects.Marker extends Gmaps.Base
2
2
 
3
3
  @include Gmaps.Google.Objects.Common
4
4
 
5
- constructor: (@serviceObject, @infowindow)->
5
+ # @infowindow is set later, once marker is clicked
6
+ constructor: (@serviceObject)->
6
7
 
7
8
  updateBounds: (bounds)->
8
9
  bounds.extend(@getServiceObject().position)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmaps4rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Roth
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-13 00:00:00.000000000 Z
12
+ date: 2013-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec