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: 9eefdd367eadd445a6ccff1588418717c108e3d2
4
- data.tar.gz: 7ba0e45b10ff38c4eae3705d4b548cf454d3a722
3
+ metadata.gz: 75a9c5f408a4e735e95a2c85ceafdeb7a57d044d
4
+ data.tar.gz: 121eb738bf373704c71984d85f49b6ff2919c473
5
5
  SHA512:
6
- metadata.gz: d6f457caf882e6249a5cc6211e897cecb57580586b046c6c22af4c04dd9ad47e019c2633a49c887ce74a3be9a712630bd0514777c970c1dea77e28697629d5a7
7
- data.tar.gz: 8b810d05a2d975fef6b3a44e456b8a9eba54a697a632af4370d5557561334e5ce2ef79684a19b1cb664cf9741d20d7a6474fc2d8303ad0a0d2792f3b0f988d05
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
- localStorage.tabulatr_page_display_count = $(this).data('items-per-page');
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
- var count = localStorage.tabulatr_page_display_count;
190
- if(count !== undefined){
191
- $('.tabulatr-per-page a').removeClass('active');
192
- $('.tabulatr-per-page a[data-items-per-page='+ count +']').
193
- addClass('active');
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
- tabulatrTable.isAPersistedTable = true;
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
- var currentStorage = JSON.parse(localStorage[this.id]);
4
- if(currentStorage !== undefined){
5
- $('.pagination[data-table='+ this.id +'] a[data-page='+ response.meta.page +']');
6
- var $table = $('#' + this.id);
7
- var tableName = this.id.split('_')[0];
8
- var sortParam = currentStorage[tableName +'_sort'];
9
- if(sortParam && sortParam != ''){
10
- var header = $table.find('th.tabulatr-sortable[data-tabulatr-column-name="'+ sortParam.split(' ')[0] +'"]');
11
- header.attr('data-sorted', sortParam.split(' ')[1]);
12
- header.addClass('sorted');
13
- $('.tabulatr_filter_form[data-table='+ this.id +'] input[name="'+ tableName +'_sort"]').val(sortParam);
14
- }
15
- $('input#'+ this.id +'_fuzzy_search_query').val(currentStorage[tableName +'_search']);
16
- var objKeys = Object.keys(currentStorage);
17
- var elem, formParent;
18
- for(var i = 0; i < objKeys.length; i++){
19
- elem = $('[name="'+ objKeys[i] +'"]');
20
- if(elem.length > 0){
21
- var val = currentStorage[objKeys[i]];
22
- elem.val(val).trigger('change');
23
- formParent = elem.parents('.tabulatr-filter-row');
24
- if(formParent.length > 0 && val && val.length > 0){
25
- $('.tabulatr-outer-wrapper[data-table-id="'+this.id+'"]').addClass('filtered')
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
- localStorage[this.id] = JSON.stringify(data);
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
- localStorage[this.id] = JSON.stringify(data);
69
+ try {
70
+ localStorage[this.id] = JSON.stringify(data);
71
+ } catch(e) {}
68
72
  }
69
73
  }
70
74
  return data;
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module Tabulatr
25
- VERSION = "0.9.27"
25
+ VERSION = "0.9.28"
26
26
  end
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.27
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-05 00:00:00.000000000 Z
13
+ date: 2016-02-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails