tabulatr2 0.9.34 → 0.9.35
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f78160470ba558135fdea0fefb2e29e11e87ae16
|
|
4
|
+
data.tar.gz: 4ecee9bdc437f1c127b6f3655c1216d7ef6c78b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4012a84a4caa68a651a3221510948debbf3fafdc14da6a3eeb1047f4b4ccb6a2a0d6616b54f06465bd79410e608a36b229b6fe963ef7324b2032c66911f31268
|
|
7
|
+
data.tar.gz: 52f710e1d5e2c74353e89c787f8342d1387183477d8eb3eeaf381b264d92df48c87638d992c94980cdb8c1b708b57452802ca109d8e566890ffb28def1495116
|
|
@@ -43,6 +43,7 @@ $(function(){
|
|
|
43
43
|
var key = a.data('do-batch-action');
|
|
44
44
|
var tableId = a.data('table-id');
|
|
45
45
|
var params = {page: 1};
|
|
46
|
+
var use_ajax = !a.data('download');
|
|
46
47
|
params[name] = key;
|
|
47
48
|
params.tabulatr_checked = {checked_ids: jQuery.map($('#'+ tableId +' .tabulatr-checkbox:checked'), function(el){return $(el).val();}).join(',')};
|
|
48
49
|
var confirmation = true;
|
|
@@ -58,7 +59,10 @@ $(function(){
|
|
|
58
59
|
table_obj = tabulatr_tables[i];
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
if (use_ajax)
|
|
63
|
+
table_obj.updateTable(params, true);
|
|
64
|
+
else
|
|
65
|
+
table_obj.sendRequestWithoutAjax(params);
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
|
|
@@ -36,6 +36,16 @@ Tabulatr.prototype = {
|
|
|
36
36
|
this.loadDataFromServer(hash);
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
+
sendRequestWithoutAjax: function(hash) {
|
|
40
|
+
var data = this.getDataForAjax(hash);
|
|
41
|
+
var url;
|
|
42
|
+
if ($('table#'+ this.id).data('path') == '#')
|
|
43
|
+
url = $(location).attr("pathname") + ".pdf?" + $.param(data)
|
|
44
|
+
else
|
|
45
|
+
url = $('table#'+ this.id).data('path') + ".pdf?" + $.param(data);
|
|
46
|
+
window.open(url);
|
|
47
|
+
},
|
|
48
|
+
|
|
39
49
|
pageShouldBeStored: function(page, forceReload){
|
|
40
50
|
return page !== undefined && !forceReload;
|
|
41
51
|
},
|
|
@@ -67,7 +77,11 @@ Tabulatr.prototype = {
|
|
|
67
77
|
data = this.createParameterString(hash, this.id);
|
|
68
78
|
if(this.isAPersistedTable) {
|
|
69
79
|
try {
|
|
70
|
-
|
|
80
|
+
var storableData = jQuery.extend(true, {}, data);
|
|
81
|
+
var batch_key = this.id.split('_')[0] + '_batch';
|
|
82
|
+
if (batch_key in storableData)
|
|
83
|
+
delete storableData[batch_key];
|
|
84
|
+
localStorage[this.id] = JSON.stringify(storableData);
|
|
71
85
|
} catch(e) {}
|
|
72
86
|
}
|
|
73
87
|
}
|
|
@@ -105,6 +119,9 @@ Tabulatr.prototype = {
|
|
|
105
119
|
},
|
|
106
120
|
|
|
107
121
|
handleResponse: function(response) {
|
|
122
|
+
if (typeof response === "string")
|
|
123
|
+
response = JSON.parse(response);
|
|
124
|
+
|
|
108
125
|
this.insertTabulatrData(response);
|
|
109
126
|
var tabulatrPagination = new TabulatrPagination(
|
|
110
127
|
response.meta.pages, response.meta.table_id);
|
|
@@ -125,11 +142,23 @@ Tabulatr.prototype = {
|
|
|
125
142
|
},
|
|
126
143
|
|
|
127
144
|
insertTabulatrData: function(response){
|
|
145
|
+
if (typeof response === "string")
|
|
146
|
+
response = JSON.parse(response);
|
|
147
|
+
|
|
128
148
|
var tableId = response.meta.table_id;
|
|
129
|
-
var
|
|
149
|
+
var table = $('#'+ tableId);
|
|
150
|
+
var tbody = table.find('tbody');
|
|
151
|
+
var ndpanel = $('#no-data-' + tableId);
|
|
130
152
|
|
|
131
153
|
this.prepareTableForInsert(tableId, response.meta.append, response.data.length, response.meta.count);
|
|
132
154
|
|
|
155
|
+
if (ndpanel.length > 0 && response.data.length == 0) {
|
|
156
|
+
table.hide();
|
|
157
|
+
ndpanel.show();
|
|
158
|
+
} else {
|
|
159
|
+
table.show();
|
|
160
|
+
ndpanel.hide();
|
|
161
|
+
}
|
|
133
162
|
|
|
134
163
|
// insert the actual data
|
|
135
164
|
for(var i = 0; i < response.data.length; i++){
|
data/lib/tabulatr/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tabulatr2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.35
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Horn
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2017-11-
|
|
13
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|