chartjs-ror 2.1.1 → 2.1.2

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: 70560e2b456473a72835faec8fb3747a4b8ca1c3
4
- data.tar.gz: a0ac4716a25acd1fe9c5d982b739147314ded6a4
3
+ metadata.gz: 223baba16a8ea746361628eafb3a4fdef27ffb0f
4
+ data.tar.gz: bed00fc2642beffc2ddb300b0b0fca9f3dafda06
5
5
  SHA512:
6
- metadata.gz: 2d8bf948ec87c2d2df3e29cae59726cd3613cae13e58d94c5f311c54e8ba2fcafa3db8336c62c642419d984cd023415048ca1e55ad8a5abb5fcf61dc2bd9a5b7
7
- data.tar.gz: 41e7684be82798cf71c7698389733507af5477997da92e77c089a566355ee58f2018a1e263c4e4b1f4e41800e1f408375d061f9611790cb1fc82280158fbc508
6
+ metadata.gz: 8807f62f6515e5e6b1f975507d1cf3a2f15dfbcd7b86a6d9d8270b4d19f5641394f4d34277ba0fad3ef8d69432bc0c7d4146c9c3ed44d96a012821f352922d62
7
+ data.tar.gz: 6721a4a5e0ade6a04ab0be10be73a235d0750c92091f351c519b40311a009668217e4db528ffafa09ee46f41f25e98fa3889569c33950406ae63265069fd74f0
data/README.md CHANGED
@@ -135,7 +135,7 @@ options = {}
135
135
  You can put anything in the `options` hash that Chart.js recognises. It also supports these non-Chart.js settings:
136
136
 
137
137
  * `:class` - class of the enclosing `<figure/>` - default is `chart`.
138
- * `:element_id` - id of the `<canvas/>` - default is `chart-n` where `n` is the 0-based index of the chart on the page.
138
+ * `:id` - id of the `<canvas/>` - default is `chart-n` where `n` is the 0-based index of the chart on the page.
139
139
  * `:width` - width of the canvas in px - default is `400`.
140
140
  * `:height` - height of the canvas in px - default is `400`.
141
141
  * `:generateLegend` - whether or not to generate a legend - default is `false`.
@@ -40,7 +40,11 @@ module Chartjs
40
40
  window.Chart && window.Chart[#{element_id.to_json}] && window.Chart[#{element_id.to_json}].destroy();
41
41
 
42
42
  var data = #{data.to_json};
43
- var opts = #{options.to_json};
43
+
44
+ var opts = #{options.reject { |k,_| ['onAnimationComplete', 'onAnimationProgress'].include? k }.to_json};
45
+ opts["onAnimationComplete"] = #{options[:onAnimationComplete] || 'function(){}'};
46
+ opts["onAnimationProgress"] = #{options[:onAnimationProgress] || 'function(){}'};
47
+
44
48
  if (!("animation" in opts)) {
45
49
  opts["animation"] = (typeof Modernizr == "undefined") || Modernizr.canvas;
46
50
  }
@@ -1,3 +1,3 @@
1
1
  module Chartjs
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartjs-ror
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails