gmaps-rails 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/gmaps/rails/version.rb +1 -1
- data/vendor/assets/javascripts/gmaps_ujs.js +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26a0d560972b052e34a3c594f71c7bc0202d05c8
|
4
|
+
data.tar.gz: 99f52a8ba562a647edb6d3f80fbc8b9e3052029d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfe5a25fc48d49ec8e43515fcd741a3d3a591dc9afe4c0c65cb16f592dcb9f3eef66a721968d445067e96d0c663fd9a3b4abccc38503cd0dbf3a77e85551462a
|
7
|
+
data.tar.gz: 02352ef846005f40fcaf0720c233fb0525f865b44ec8dc2f149621ab9281c212defef22d8b53f6633790d5f27639e283fe9761e03ba6853ca22e48af266e6e34
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ simply by requiring `gmaps` in `app/assets/javascripts/application.js` file.
|
|
52
52
|
#### GMaps in Ruby
|
53
53
|
In addition to that, this gem has helpers.
|
54
54
|
|
55
|
-
You can define GMaps object in a controller or
|
55
|
+
You can define GMaps object in a controller or presenter \(such as [Draper](https://github.com/drapergem/draper)\).
|
56
56
|
|
57
57
|
```ruby
|
58
58
|
@map = GMaps.new(div: '#map', lat: -12.043333, lng: -77.028333)
|
@@ -73,7 +73,7 @@ You can show maps as follows:
|
|
73
73
|
<script>
|
74
74
|
jQuery(function() {
|
75
75
|
<%= @map.to_js %>
|
76
|
-
}
|
76
|
+
})
|
77
77
|
</script>
|
78
78
|
<body>
|
79
79
|
<div sytle='width: 800px'>
|
data/lib/gmaps/rails/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
(function($, undefined) {
|
2
|
-
|
2
|
+
var gmapsUjs = function() {
|
3
3
|
var mapElements = $('[data-map]');
|
4
4
|
for (var mi = 0, len = mapElements.length; mi < len; mi++) {
|
5
5
|
var mapElement = $(mapElements[mi]);
|
@@ -11,5 +11,11 @@
|
|
11
11
|
map[d.name].apply(map, d.args);
|
12
12
|
}
|
13
13
|
}
|
14
|
-
}
|
14
|
+
};
|
15
|
+
|
16
|
+
if ((typeof Turbolinks === 'undefined') || $.turbo) {
|
17
|
+
$(gmapsUjs);
|
18
|
+
} else {
|
19
|
+
$(document).on("page:change", gmapsUjs);
|
20
|
+
}
|
15
21
|
})( jQuery );
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmaps-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Imai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|