Skip to content

Commit d6ca877

Browse files
committed
v3.3.6 - fix 'rowspan' logic, closes clarketm#27
1 parent d34d68c commit d6ca877

10 files changed

Lines changed: 46 additions & 22 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.5",
3+
"version": "3.3.6",
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.5 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.6 (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: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js v3.3.5 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.6 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -87,8 +87,14 @@
8787
rcMap[ir + i][ic] = 1
8888
}
8989
}
90-
if (rcMap[ir] && rcMap[ir][ic]) {
91-
return new Array(rcMap[ir][ic]).concat($(val).text());
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++];
96+
}
97+
return new Array(total).concat($(val).text());
9298
}
9399
return $(val).text();
94100
}).get()];
@@ -128,8 +134,14 @@
128134
rcMap[ir + i][ic] = 1
129135
}
130136
}
131-
if (rcMap[ir] && rcMap[ir][ic]) {
132-
return new Array(rcMap[ir][ic]).concat($(val).text());
137+
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++];
143+
}
144+
return new Array(total).concat($(val).text());
133145
}
134146
return $(val).text();
135147
}).get()];
@@ -270,7 +282,7 @@
270282
* Version.
271283
* @memberof TableExport.prototype
272284
*/
273-
version: "3.3.5",
285+
version: "3.3.6",
274286
/**
275287
* Default plugin options.
276288
* @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.5",
3+
"version": "3.3.6",
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.5 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.6 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/

0 commit comments

Comments
 (0)