activeadmin_latlng 1.4.0 → 1.5.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: 4a24a5a985decc74f54b4160d88475ffbdd2a8fb
4
- data.tar.gz: ef6f6533b89be67cbcd47099ca119dc716452137
3
+ metadata.gz: 35d27de2cf7400cccada2862027ee28908b856fd
4
+ data.tar.gz: 3df1e7d3e25b77fa7b7203558a15ecd1cc7410ff
5
5
  SHA512:
6
- metadata.gz: 6979d6cac46f79da5241de56baea9e44b626364b06964ce6624e127e4c6c96f61a2964cc05b48c3f10f35cac1bde436049feb480c04c7b2ebb2d37e807f65810
7
- data.tar.gz: c349caab7fb929e62f4a6f7ab6ef6018264582c48ddde2988880201c22d52f21fdd5c136eccb8ff63cbde98790cc27f3350507281366d3cb3989a5ba1cd5248f
6
+ metadata.gz: 0500a29355e9fe01f5fb9fac85200453e8c8d01de27aa0ff837057ed90cc8fc8b4bc36be12f781e3c50ab274e2a180449bbdc59ecf8fda93ca12e2f7025e26e1
7
+ data.tar.gz: e850f7c5fdc2a8a056c4747a446ade164ca47afaa89e07fb26f91ec774c7e69064b8d2577dff0ea09c08767ddd1a9cac221510fdc52a1a8c1053d39bf58d800c
@@ -63,6 +63,13 @@
63
63
  });
64
64
  },
65
65
 
66
+ getCoordinates: function() {
67
+ return {
68
+ lat: parseFloat($("#" + osmObject.idLat).val()) || <%= default_lat %>,
69
+ lng: parseFloat($("#" + osmObject.idLng).val()) || <%= default_lng %>,
70
+ };
71
+ },
72
+
66
73
  newLocation: function(item) {
67
74
  $("#"+osmObject.idLat).val(item.lat);
68
75
  $("#"+osmObject.idLng).val(item.lon);
@@ -88,7 +95,8 @@
88
95
  }
89
96
 
90
97
  $(document).ready(function () {
91
- osmObject.init(<%= default_lat %>, <%= default_lng %>);
98
+ var coordinates = osmObject.getCoordinates();
99
+ osmObject.init(coordinates.lat, coordinates.lng);
92
100
  });
93
101
  </script>
94
102
  <style>
@@ -96,12 +104,12 @@
96
104
  height: 18px;
97
105
  position: relative;
98
106
  left: 52px;
99
- top: 39px;
107
+ top: 44px;
100
108
  max-width: 400px;
101
109
  z-index: 2;
102
110
  border-radius: 4px;
103
111
  }
104
112
  </style>
105
- <input id="latlng-search-box" class="leaflet-bar" type="text" style="" placeholder="Search address...">
113
+ <input id="latlng-search-box" class="leaflet-bar" type="text" style="" placeholder="Type address and hit enter...">
106
114
  <div id="locationPicker" style="width: auto; height: <%= height %>px;"></div>
107
115
  </li>
@@ -1,3 +1,3 @@
1
1
  module ActiveadminLatlng
2
- VERSION = "1.4.0".freeze
2
+ VERSION = "1.5.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_latlng
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Krylov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-15 00:00:00.000000000 Z
11
+ date: 2019-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin