Skip to content

Commit 87824df

Browse files
committed
v3.3.7 - improve 'rowspan' logic
1 parent 3beefbd commit 87824df

10 files changed

Lines changed: 50 additions & 34 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tableexport.js",
3-
"version": "3.3.6",
3+
"version": "3.3.7",
44
"authors": [
55
"clarketm <travis.m.clarke@gmail.com>"
66
],

dist/css/tableexport.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js v3.3.6 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.7 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/

dist/css/tableexport.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/tableexport.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js v3.3.6 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.7 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -88,11 +88,15 @@
8888
}
8989
}
9090
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+
}
96100
}
97101
return new Array(total).concat($(val).text());
98102
}
@@ -135,11 +139,15 @@
135139
}
136140
}
137141
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+
}
143151
}
144152
return new Array(total).concat($(val).text());
145153
}
@@ -282,7 +290,7 @@
282290
* Version.
283291
* @memberof TableExport.prototype
284292
*/
285-
version: "3.3.6",
293+
version: "3.3.7",
286294
/**
287295
* Default plugin options.
288296
* @memberof TableExport.prototype

dist/js/tableexport.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tableexport",
3-
"version": "3.3.6",
3+
"version": "3.3.7",
44
"authors": [
55
"clarketm <travis.m.clarke@gmail.com>"
66
],

src/stable/css/tableexport.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js v3.3.6 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.7 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/

0 commit comments

Comments
 (0)