rgviz-rails 0.53 → 0.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rgviz_rails/view_helper.rb +14 -13
  2. metadata +4 -4
@@ -20,7 +20,7 @@ module Rgviz
20
20
  hidden = options[:hidden]
21
21
  extensions = options[:extensions]
22
22
 
23
- rgviz_events, google_events = events.partition{|x| x.to_s.start_with? 'rgviz'}
23
+ rgviz_events, google_events = events.partition{|x| x[0].to_s.start_with? 'rgviz'}
24
24
  rgviz_events = rgviz_events.inject(Hash.new){|h, y| h[y[0]] = y[1]; h}
25
25
  rgviz_events = rgviz_events.with_indifferent_access
26
26
 
@@ -167,20 +167,21 @@ module Rgviz
167
167
 
168
168
  # And define the callback
169
169
  out << "function #{callback}(#{params.join(', ')}) {\n"
170
- out << "#{rgviz_events[:rgviz_start]}('#{id}');\n" if rgviz_events[:rgviz_start]
171
- out << "var query = new google.visualization.Query('#{url}');\n"
172
- out << "#{query_builder}\n"
173
- out << "alert(#{query_builder_var});\n" if debug
174
- out << "query.setQuery(#{query_builder_var});\n"
175
- out << "query.send(function(response) {\n"
176
- out << "rgviz_#{id} = new google.visualization.#{kind}(document.getElementById('#{id}'));\n"
170
+ out << " #{rgviz_events[:rgviz_start]}('#{id}');\n" if rgviz_events[:rgviz_start]
171
+ out << " var query = new google.visualization.Query('#{url}');\n"
172
+ out << " #{query_builder}\n"
173
+ out << " alert(#{query_builder_var});\n" if debug
174
+ out << " query.setQuery(#{query_builder_var});\n"
175
+ out << " query.send(function(response) {\n"
176
+ out << " rgviz_#{id} = new google.visualization.#{kind}(document.getElementById('#{id}'));\n"
177
177
  google_events.each do |name, handler|
178
- out << "google.visualization.events.addListener(rgviz_#{id}, '#{name}', #{handler});\n"
178
+ out << " google.visualization.events.addListener(rgviz_#{id}, '#{name}', #{handler});\n"
179
179
  end
180
- out << "rgviz_#{id}_data = response.getDataTable();\n"
181
- out << "rgviz_#{id}.draw(rgviz_#{id}_data, #{opts});\n"
182
- out << "#{rgviz_events[:rgviz_end]}('#{id}');\n" if rgviz_events[:rgviz_end]
183
- out << "});\n"
180
+ out << " rgviz_#{id}_data = response.getDataTable();\n"
181
+ out << " #{rgviz_events[:rgviz_before_draw]}(rgviz_#{id}, rgviz_#{id}_data);\n" if rgviz_events[:rgviz_before_draw]
182
+ out << " rgviz_#{id}.draw(rgviz_#{id}_data, #{opts});\n"
183
+ out << " #{rgviz_events[:rgviz_end]}('#{id}');\n" if rgviz_events[:rgviz_end]
184
+ out << " });\n"
184
185
  out << "}\n"
185
186
 
186
187
  out << "</script>\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgviz-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.53'
4
+ version: '0.54'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-18 00:00:00.000000000Z
12
+ date: 2012-01-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rgviz
16
- requirement: &70094420919240 !ruby/object:Gem::Requirement
16
+ requirement: &70276898913000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70094420919240
24
+ version_requirements: *70276898913000
25
25
  description:
26
26
  email: aborenszweig@manas.com.ar
27
27
  executables: []