chartkick 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of chartkick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/chartkick/helper.rb +4 -4
- data/lib/chartkick/version.rb +1 -1
- 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: ca23cf2a483dec9fdb551db05a0026cebaffb654
|
4
|
+
data.tar.gz: 787086c3fa0287b611c5895c1fe5c43902347b05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a4dcfde3aeb6f4068cda287772d4d36d3280eb88bbc9b64172b8d678f34319ffc89ab55e50b7e88ae38bd3041e9f56c26826ca151ad6880c9cbefba6518d96c
|
7
|
+
data.tar.gz: 2a3ee87316b2aa0c8faef093a042c8a7126d13b8b96adacec8623cb331465e8b26dc10a22c5c2a0cf546c0236d3dbba0e2ea49d7517fc0d28a46e8706df0f370
|
data/CHANGELOG.md
CHANGED
data/lib/chartkick/helper.rb
CHANGED
@@ -37,16 +37,16 @@ module Chartkick
|
|
37
37
|
def chartkick_chart(klass, data_source, options, &block)
|
38
38
|
@chartkick_chart_id ||= 0
|
39
39
|
options = chartkick_deep_merge(Chartkick.options, options)
|
40
|
-
element_id = options
|
41
|
-
height = options
|
40
|
+
element_id = options.delete(:id) || "chart-#{@chartkick_chart_id += 1}"
|
41
|
+
height = options.delete(:height) || "300px"
|
42
42
|
# content_for: nil must override default
|
43
43
|
content_for = options.has_key?(:content_for) ? options.delete(:content_for) : Chartkick.content_for
|
44
44
|
|
45
|
-
html = (options
|
45
|
+
html = (options.delete(:html) || %[<div id="%{id}" style="height: %{height}; text-align: center; color: #999; line-height: %{height}; font-size: 14px; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif;">Loading...</div>]) % {id: ERB::Util.html_escape(element_id), height: ERB::Util.html_escape(height)}
|
46
46
|
|
47
47
|
js = <<JS
|
48
48
|
<script type="text/javascript">
|
49
|
-
new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.respond_to?(:chart_json) ? data_source.chart_json : data_source.to_json}, #{options.
|
49
|
+
new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.respond_to?(:chart_json) ? data_source.chart_json : data_source.to_json}, #{options.to_json});
|
50
50
|
</script>
|
51
51
|
JS
|
52
52
|
if content_for
|
data/lib/chartkick/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chartkick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|