effective_datatables 2.12.0 → 2.12.1
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 +4 -4
- data/app/assets/javascripts/effective_datatables/charts.js.coffee +14 -3
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +5 -4
- data/app/assets/stylesheets/effective_datatables/{_overrides.scss.erb → _overrides.scss} +4 -9
- data/app/helpers/effective_datatables_helper.rb +1 -3
- data/app/models/effective/effective_datatable/ajax.rb +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ee8baa7089062ecb467e023374ca3ee9f8b5e9b
|
4
|
+
data.tar.gz: 54808a68095bbdc2950e329be40a0f195d81a44b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac424c688acd674ee6edd14791d1ffab0258c91e4f06e1b4dde28bb1d8bb4f73f62e4f74b681bd8b9afcbe623cedd7ff930df382d5ec1525a58eb4e1dc63142b
|
7
|
+
data.tar.gz: abb7e1eeadd0153336d59501cbc241964c1d6815ea6393f4e2c862f8c89cef9be1bba8d4499bc5e0fc9d3ff703e5934227e44ab0daf889d1c91359c5a6d0a4fe
|
@@ -1,4 +1,16 @@
|
|
1
1
|
initializeCharts = ->
|
2
|
+
$charts = $('.effective-datatables-chart:not(.initialized)')
|
3
|
+
return unless $charts.length > 0
|
4
|
+
|
5
|
+
if typeof(google) != 'undefined' && typeof(google.charts) != 'undefined'
|
6
|
+
google.charts.load('current', { packages: ['corechart'] })
|
7
|
+
google.charts.setOnLoadCallback(renderCharts)
|
8
|
+
|
9
|
+
$charts.addClass('initialized')
|
10
|
+
|
11
|
+
renderCharts = ->
|
12
|
+
return if (typeof(google) == 'undefined' || typeof(google.visualization) == 'undefined')
|
13
|
+
|
2
14
|
$('.effective-datatables-chart').each ->
|
3
15
|
$chart = $(this)
|
4
16
|
|
@@ -6,9 +18,8 @@ initializeCharts = ->
|
|
6
18
|
type = $chart.data('type') || 'BarChart'
|
7
19
|
options = $chart.data('options') || {}
|
8
20
|
|
9
|
-
|
10
|
-
|
11
|
-
chart.draw(google.visualization.arrayToDataTable(data), options)
|
21
|
+
chart = new google.visualization[type](document.getElementById($chart.attr('id')))
|
22
|
+
chart.draw(google.visualization.arrayToDataTable(data), options)
|
12
23
|
|
13
24
|
$ -> initializeCharts()
|
14
25
|
$(document).on 'page:change', -> initializeCharts()
|
@@ -119,10 +119,11 @@ initializeDataTables = ->
|
|
119
119
|
$.each values, (col, value) => $row.children().eq(col).html(value)
|
120
120
|
|
121
121
|
drawCharts = ($table, charts) ->
|
122
|
-
|
123
|
-
|
124
|
-
chart
|
125
|
-
|
122
|
+
if typeof(google) != 'undefined' && typeof(google.visualization) != 'undefined'
|
123
|
+
$.each charts, (name, data) =>
|
124
|
+
$(".effective-datatables-chart[data-name='#{name}']").each (_, obj) =>
|
125
|
+
chart = new google.visualization[data['type']](obj)
|
126
|
+
chart.draw(google.visualization.arrayToDataTable(data['data']), data['options'])
|
126
127
|
|
127
128
|
# Appends the filter html, stored in the column definitions, into each column header
|
128
129
|
initializeFilters = (api) ->
|
@@ -1,16 +1,16 @@
|
|
1
|
-
// Use
|
1
|
+
// Use asset-data-url to prevent 3 additional GET requests for icons
|
2
2
|
table.dataTable thead .sorting {
|
3
|
-
background-image: url(
|
3
|
+
background-image: asset-data-url('dataTables/sort_both.png');
|
4
4
|
background-position: 100% 70%;
|
5
5
|
}
|
6
6
|
|
7
7
|
table.dataTable thead .sorting_asc {
|
8
|
-
background-image: url(
|
8
|
+
background-image: asset-data-url('dataTables/sort_asc.png');
|
9
9
|
background-position: 100% 70%;
|
10
10
|
}
|
11
11
|
|
12
12
|
table.dataTable thead .sorting_desc {
|
13
|
-
background-image: url(
|
13
|
+
background-image: asset-data-url('dataTables/sort_desc.png');
|
14
14
|
background-position: 100% 70%;
|
15
15
|
}
|
16
16
|
|
@@ -37,11 +37,6 @@ table.dataTable thead tr th {
|
|
37
37
|
.form-group { margin-bottom: 0px; font-weight: normal; }
|
38
38
|
}
|
39
39
|
|
40
|
-
table.dataTable td ul {
|
41
|
-
list-style: none;
|
42
|
-
padding-left: 0;
|
43
|
-
}
|
44
|
-
|
45
40
|
// Sorting disabled
|
46
41
|
table.dataTable.sort-hidden thead .sorting { background-image: none; }
|
47
42
|
table.dataTable.sort-hidden thead .sorting_asc { background-image: none; }
|
@@ -58,9 +58,7 @@ module EffectiveDatatablesHelper
|
|
58
58
|
datatable.view ||= self
|
59
59
|
|
60
60
|
unless @effective_datatables_chart_javascript_rendered
|
61
|
-
concat javascript_include_tag('https://www.
|
62
|
-
concat javascript_tag("if(google && google.visualization === undefined) { google.load('visualization', '1', {packages:#{EffectiveDatatables.google_chart_packages}}); }")
|
63
|
-
|
61
|
+
concat javascript_include_tag('https://www.gstatic.com/charts/loader.js', data: { 'turbolinks-track' => :reload, 'turbolinks-eval' => false })
|
64
62
|
@effective_datatables_chart_javascript_rendered = true
|
65
63
|
end
|
66
64
|
|
@@ -49,7 +49,7 @@ module Effective
|
|
49
49
|
@display_entries ||= begin
|
50
50
|
entries = (@default_entries.presence || EffectiveDatatables.default_entries)
|
51
51
|
entries = -1 if entries.to_s.downcase == 'all'
|
52
|
-
[10, 25, 50, 100, 250, 1000, -1].include?(entries) ? entries : 25
|
52
|
+
[5, 10, 25, 50, 100, 250, 1000, -1].include?(entries) ? entries : 25
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
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.
|
4
|
+
version: 2.12.1
|
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-
|
11
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -133,7 +133,7 @@ files:
|
|
133
133
|
- app/assets/stylesheets/dataTables/dataTables.bootstrap.css
|
134
134
|
- app/assets/stylesheets/dataTables/responsive/responsive.bootstrap.css
|
135
135
|
- app/assets/stylesheets/effective_datatables.scss
|
136
|
-
- app/assets/stylesheets/effective_datatables/_overrides.scss
|
136
|
+
- app/assets/stylesheets/effective_datatables/_overrides.scss
|
137
137
|
- app/assets/stylesheets/effective_datatables/_scopes.scss
|
138
138
|
- app/controllers/effective/datatables_controller.rb
|
139
139
|
- app/helpers/effective_datatables_controller_helper.rb
|