|
1 | 1 | /*! |
2 | | - * TableExport.js v3.3.6 (https://www.travismclarke.com) |
| 2 | + * TableExport.js v3.3.7 (https://www.travismclarke.com) |
3 | 3 | * Copyright 2016 Travis Clarke |
4 | 4 | * Licensed under the MIT license |
5 | 5 | */ |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | if (rcMap[ir]) { |
91 | | - var total = 0, |
92 | | - min = Math.min.apply(Math, Object.keys(rcMap[ir])), |
93 | | - max = Math.max.apply(Math, Object.keys(rcMap[ir])); |
94 | | - while (min < max && rcMap[ir][min]) { |
95 | | - total += rcMap[ir][min] && delete rcMap[ir][min++]; |
| 91 | + var threshold = ic + 1, |
| 92 | + total = 0, |
| 93 | + count = 0; |
| 94 | + |
| 95 | + for (var i = 0; i <= Math.max.apply(Math, Object.keys(rcMap[ir])); i++) { |
| 96 | + (!rcMap[ir][i]) ? count++ : total = count >= ic ? total + rcMap[ir][i] : total; |
| 97 | + if (count === threshold) { |
| 98 | + break; |
| 99 | + } |
96 | 100 | } |
97 | 101 | return new Array(total).concat($(val).text()); |
98 | 102 | } |
|
135 | 139 | } |
136 | 140 | } |
137 | 141 | if (rcMap[ir]) { |
138 | | - var total = 0, |
139 | | - min = Math.min.apply(Math, Object.keys(rcMap[ir])), |
140 | | - max = Math.max.apply(Math, Object.keys(rcMap[ir])); |
141 | | - while (min < max && rcMap[ir][min]) { |
142 | | - total += rcMap[ir][min] && delete rcMap[ir][min++]; |
| 142 | + var threshold = ic + 1, |
| 143 | + total = 0, |
| 144 | + count = 0; |
| 145 | + |
| 146 | + for (var i = 0; i <= Math.max.apply(Math, Object.keys(rcMap[ir])); i++) { |
| 147 | + (!rcMap[ir][i]) ? count++ : total = count >= ic ? total + rcMap[ir][i] : total; |
| 148 | + if (count === threshold) { |
| 149 | + break; |
| 150 | + } |
143 | 151 | } |
144 | 152 | return new Array(total).concat($(val).text()); |
145 | 153 | } |
|
282 | 290 | * Version. |
283 | 291 | * @memberof TableExport.prototype |
284 | 292 | */ |
285 | | - version: "3.3.6", |
| 293 | + version: "3.3.7", |
286 | 294 | /** |
287 | 295 | * Default plugin options. |
288 | 296 | * @memberof TableExport.prototype |
|
0 commit comments