effective_datatables 2.12.1 → 2.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ee8baa7089062ecb467e023374ca3ee9f8b5e9b
4
- data.tar.gz: 54808a68095bbdc2950e329be40a0f195d81a44b
3
+ metadata.gz: 5eed7737db95090d9972bd497d03167274bbcc33
4
+ data.tar.gz: fc60bd7d87417e5ced94f4d6dbd49256acb49a97
5
5
  SHA512:
6
- metadata.gz: ac424c688acd674ee6edd14791d1ffab0258c91e4f06e1b4dde28bb1d8bb4f73f62e4f74b681bd8b9afcbe623cedd7ff930df382d5ec1525a58eb4e1dc63142b
7
- data.tar.gz: abb7e1eeadd0153336d59501cbc241964c1d6815ea6393f4e2c862f8c89cef9be1bba8d4499bc5e0fc9d3ff703e5934227e44ab0daf889d1c91359c5a6d0a4fe
6
+ metadata.gz: 8877d69b948273ec1bea41665817a76f12652bacd442fbaa64dfcc4066462d198d96d949aa6b420ede4f52c749c3ddd63230522c6813fa297806d854fe4cd40d
7
+ data.tar.gz: 33b000a3a093f9cf0f6c08379b924538b34fed19e3cac1aee3b9de9a79cfe54ea6af05ef1fad3b6f7dcf177f435e7ba896eb9f73a7745db715584d113973b0aa
@@ -1,13 +1,18 @@
1
1
  initializeCharts = ->
2
2
  $charts = $('.effective-datatables-chart:not(.initialized)')
3
- return unless $charts.length > 0
3
+ return if $charts.length == 0
4
4
 
5
- if typeof(google) != 'undefined' && typeof(google.charts) != 'undefined'
6
- google.charts.load('current', { packages: ['corechart'] })
7
- google.charts.setOnLoadCallback(renderCharts)
5
+ if typeof(google) == 'undefined' || typeof(google.charts) == 'undefined'
6
+ $.getScript 'https://www.gstatic.com/charts/loader.js', -> loadCharts()
7
+ else
8
+ loadCharts()
8
9
 
9
10
  $charts.addClass('initialized')
10
11
 
12
+ loadCharts = ->
13
+ google.charts.load('current', { packages: ['corechart'] })
14
+ google.charts.setOnLoadCallback(renderCharts)
15
+
11
16
  renderCharts = ->
12
17
  return if (typeof(google) == 'undefined' || typeof(google.visualization) == 'undefined')
13
18
 
@@ -57,11 +57,6 @@ module EffectiveDatatablesHelper
57
57
  return unless datatable.charts[name].present?
58
58
  datatable.view ||= self
59
59
 
60
- unless @effective_datatables_chart_javascript_rendered
61
- concat javascript_include_tag('https://www.gstatic.com/charts/loader.js', data: { 'turbolinks-track' => :reload, 'turbolinks-eval' => false })
62
- @effective_datatables_chart_javascript_rendered = true
63
- end
64
-
65
60
  options = datatable.charts[name]
66
61
  chart = datatable.to_json[:charts][name]
67
62
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '2.12.1'.freeze
2
+ VERSION = '2.12.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.1
4
+ version: 2.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails