tabulatr2 0.9.27 → 0.9.28
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75a9c5f408a4e735e95a2c85ceafdeb7a57d044d
|
4
|
+
data.tar.gz: 121eb738bf373704c71984d85f49b6ff2919c473
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bec5aa103d9c50da0992b707e31bdc86c0cf9fe9ebc97d732e979287df0c512cf43aab62ae73e6f53aaaa73a33b97e261e5eb7786708d55cc969a5303f53aec
|
7
|
+
data.tar.gz: 1726ea44a0115317d382bd08df1300b6de602c83d73f46ded450f6995467c68a919299f6f7bc9e545133e2b6305cfdc1ad2cac3d62e69bc12413b81b9f9f5084
|
@@ -165,7 +165,9 @@ $(document).on('ready page:load', function(){
|
|
165
165
|
$('.pagination_trigger[data-table='+ tableId +']').bind('inview', cbfn);
|
166
166
|
}
|
167
167
|
if(typeof(Storage) !== undefined){
|
168
|
-
|
168
|
+
try {
|
169
|
+
localStorage.tabulatr_page_display_count = $(this).data('items-per-page');
|
170
|
+
} catch(e) {}
|
169
171
|
}
|
170
172
|
table_obj.updateTable({page: 1}, true);
|
171
173
|
});
|
@@ -186,19 +188,24 @@ $(document).on('ready page:load', function(){
|
|
186
188
|
|
187
189
|
if($('.tabulatr_table:not(".tabulatr_static_table")').length > 0){
|
188
190
|
if(typeof(Storage) !== undefined){
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
191
|
+
try {
|
192
|
+
var count = localStorage.tabulatr_page_display_count;
|
193
|
+
if(count !== undefined){
|
194
|
+
$('.tabulatr-per-page a').removeClass('active');
|
195
|
+
$('.tabulatr-per-page a[data-items-per-page='+ count +']').
|
196
|
+
addClass('active');
|
197
|
+
}
|
198
|
+
} catch(e) {}
|
195
199
|
}
|
196
200
|
var tableObj, tableId, tabulatrTable;
|
197
201
|
$('.tabulatr_table:not(".tabulatr_static_table")').each(function(ix, el){
|
198
202
|
tableId = $(el).attr('id');
|
199
203
|
tabulatrTable = new Tabulatr(tableId);
|
200
204
|
if($(el).data('persistent')){
|
201
|
-
|
205
|
+
try {
|
206
|
+
localStorage._tabulatr_test = 1;
|
207
|
+
tabulatrTable.isAPersistedTable = true;
|
208
|
+
} catch(e) {}
|
202
209
|
}
|
203
210
|
if($('.pagination[data-table='+ tableId +']').length === 0){
|
204
211
|
tabulatrTable.hasInfiniteScrolling = true;
|
@@ -1,32 +1,34 @@
|
|
1
1
|
$(function(){
|
2
2
|
Tabulatr.prototype.retrieveTableFromLocalStorage = function(response){
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
3
|
+
try {
|
4
|
+
var currentStorage = JSON.parse(localStorage[this.id]);
|
5
|
+
if(currentStorage !== undefined){
|
6
|
+
$('.pagination[data-table='+ this.id +'] a[data-page='+ response.meta.page +']');
|
7
|
+
var $table = $('#' + this.id);
|
8
|
+
var tableName = this.id.split('_')[0];
|
9
|
+
var sortParam = currentStorage[tableName +'_sort'];
|
10
|
+
if(sortParam && sortParam != ''){
|
11
|
+
var header = $table.find('th.tabulatr-sortable[data-tabulatr-column-name="'+ sortParam.split(' ')[0] +'"]');
|
12
|
+
header.attr('data-sorted', sortParam.split(' ')[1]);
|
13
|
+
header.addClass('sorted');
|
14
|
+
$('.tabulatr_filter_form[data-table='+ this.id +'] input[name="'+ tableName +'_sort"]').val(sortParam);
|
15
|
+
}
|
16
|
+
$('input#'+ this.id +'_fuzzy_search_query').val(currentStorage[tableName +'_search']);
|
17
|
+
var objKeys = Object.keys(currentStorage);
|
18
|
+
var elem, formParent;
|
19
|
+
for(var i = 0; i < objKeys.length; i++){
|
20
|
+
elem = $('[name="'+ objKeys[i] +'"]');
|
21
|
+
if(elem.length > 0){
|
22
|
+
var val = currentStorage[objKeys[i]];
|
23
|
+
elem.val(val).trigger('change');
|
24
|
+
formParent = elem.parents('.tabulatr-filter-row');
|
25
|
+
if(formParent.length > 0 && val && val.length > 0){
|
26
|
+
$('.tabulatr-outer-wrapper[data-table-id="'+this.id+'"]').addClass('filtered')
|
27
|
+
}
|
26
28
|
}
|
27
29
|
}
|
28
30
|
}
|
29
|
-
}
|
31
|
+
} catch(e) {}
|
30
32
|
};
|
31
33
|
|
32
34
|
Tabulatr.prototype.resetTable = function(){
|
@@ -50,7 +50,9 @@ Tabulatr.prototype = {
|
|
50
50
|
tabulatrPagination.updatePagination(hash.page);
|
51
51
|
if(this.isAPersistedTable){
|
52
52
|
var data = this.createParameterString(hash, this.id);
|
53
|
-
|
53
|
+
try {
|
54
|
+
localStorage[this.id] = JSON.stringify(data);
|
55
|
+
} catch(e) {}
|
54
56
|
}
|
55
57
|
return true;
|
56
58
|
}
|
@@ -64,7 +66,9 @@ Tabulatr.prototype = {
|
|
64
66
|
}else{
|
65
67
|
data = this.createParameterString(hash, this.id);
|
66
68
|
if(this.isAPersistedTable) {
|
67
|
-
|
69
|
+
try {
|
70
|
+
localStorage[this.id] = JSON.stringify(data);
|
71
|
+
} catch(e) {}
|
68
72
|
}
|
69
73
|
}
|
70
74
|
return data;
|
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.28
|
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: 2016-02-
|
13
|
+
date: 2016-02-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|