leaflet-sidebar-rails 0.1.9 → 0.2.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: a404f563ee5dc6c4cf4af85ca9cd1ee39cab95ce
4
- data.tar.gz: ff0953cf6e72e9518ed8ce9385dc239e61072ec4
3
+ metadata.gz: 2652c84e0d2561728aa5153c72b8ebad2dee5bb4
4
+ data.tar.gz: 8238489d8adee22e29ac6bfd5cf15f88026587b9
5
5
  SHA512:
6
- metadata.gz: 815ecdb6d98f3ac4f7f5ef8c72d48e1e4124e884f43d54c95fd7a869d6640f78f495cbb26544c6a840210204930db4dada096c60d6c7c6ff57d6913a77cc080a
7
- data.tar.gz: 78a18dddf4ba29afdac940a8dd7b805f7979d3ae6b212c1ed06fef37cc3219f8befc3d7a76e52e632587ebf762cb8c96b072630bf03a302695a7ca88a3bc2d17
6
+ metadata.gz: a36ac7550f494cf97212c0c2b324d08564011b7be2f6e92339ab8501b77f04ed9f612c6f640744f249c3f709e6514f5b9596dd8ae7a21bc1921b7c779a6caaf2
7
+ data.tar.gz: 1cada2eec4c86c0b78b09459bd866ae446c0cb78771c4edf7a8781c38e7fee82b19eced889570936a331d4038461015250d0aa1b8800eea177628e2934b77361
@@ -1,7 +1,7 @@
1
1
  module Leaflet
2
2
  module Sidebar
3
3
  module Rails
4
- VERSION = '0.1.9'
4
+ VERSION = '0.2.0'
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  L.Control.Sidebar = L.Control.extend({
2
2
 
3
- includes: L.Mixin.Events,
3
+ includes: (L.Evented.prototype || L.Mixin.Events),
4
4
 
5
5
  options: {
6
6
  closeButton: true,
@@ -162,7 +162,19 @@ L.Control.Sidebar = L.Control.extend({
162
162
  },
163
163
 
164
164
  setContent: function (content) {
165
- this.getContainer().innerHTML = content;
165
+ var container = this.getContainer();
166
+
167
+ if (typeof content === 'string') {
168
+ container.innerHTML = content;
169
+ } else {
170
+ // clean current content
171
+ while (container.firstChild) {
172
+ container.removeChild(container.firstChild);
173
+ }
174
+
175
+ container.appendChild(content);
176
+ }
177
+
166
178
  return this;
167
179
  },
168
180
 
@@ -182,4 +194,4 @@ L.Control.Sidebar = L.Control.extend({
182
194
 
183
195
  L.control.sidebar = function (placeholder, options) {
184
196
  return new L.Control.Sidebar(placeholder, options);
185
- };
197
+ };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaflet-sidebar-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-27 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 2.4.5.1
65
+ rubygems_version: 2.6.14
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Rails plugin for Leaflet-Sidebar plugin