Skip to content

Commit e6f8b84

Browse files
committed
v4.0.0-alpha.3 - fix 'rowspan' logic
1 parent aa98730 commit e6f8b84

11 files changed

Lines changed: 47 additions & 23 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $ npm install tableexport
4040
* [jQuery](https://jquery.com) (1.2.1 or higher) `*`
4141
* [FileSaver.js](https://github.com/clarketm/FileSaver.js/)
4242

43-
> `*` jQuery dependency requirement is removed as of [4.0.0-alpha.2](https://github.com/clarketm/TableExport/tree/v4.0.0-alpha.2)
43+
> `*` jQuery dependency requirement is removed as of [4.0.0-alpha.3](https://github.com/clarketm/TableExport/tree/v4.0.0-alpha.3)
4444
4545
#### Optional / Theming:
4646

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": "4.0.0-alpha.2",
3+
"version": "4.0.0-alpha.3",
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 4.0.0-alpha.2 (https://www.travismclarke.com)
2+
* TableExport.js 4.0.0-alpha.3 (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 4.0.0-alpha.2 (https://www.travismclarke.com)
2+
* TableExport.js 4.0.0-alpha.3 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -86,8 +86,14 @@
8686
rcMap[ir + i][ic] = 1
8787
}
8888
}
89-
if (rcMap[ir] && rcMap[ir][ic]) {
90-
return new Array(rcMap[ir][ic]).concat(val.textContent);
89+
if (rcMap[ir]) {
90+
var total = 0,
91+
min = Math.min.apply(Math, Object.keys(rcMap[ir])),
92+
max = Math.max.apply(Math, Object.keys(rcMap[ir]));
93+
while (min < max && rcMap[ir][min]) {
94+
total += rcMap[ir][min] && delete rcMap[ir][min++];
95+
}
96+
return new Array(total).concat(val.textContent);
9197
}
9298
return val.textContent;
9399
});
@@ -127,8 +133,14 @@
127133
rcMap[ir + i][ic] = 1
128134
}
129135
}
130-
if (rcMap[ir] && rcMap[ir][ic]) {
131-
return new Array(rcMap[ir][ic]).concat(val.textContent);
136+
if (rcMap[ir]) {
137+
var total = 0,
138+
min = Math.min.apply(Math, Object.keys(rcMap[ir])),
139+
max = Math.max.apply(Math, Object.keys(rcMap[ir]));
140+
while (min < max && rcMap[ir][min]) {
141+
total += rcMap[ir][min] && delete rcMap[ir][min++];
142+
}
143+
return new Array(total).concat(val.textContent);
132144
}
133145
return val.textContent;
134146
});
@@ -277,7 +289,7 @@
277289
* Version.
278290
* @memberof TableExport.prototype
279291
*/
280-
version: "4.0.0-alpha.2",
292+
version: "4.0.0-alpha.3",
281293
/**
282294
* Default plugin options.
283295
* @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": "4.0.0-alpha.2",
3+
"version": "4.0.0-alpha.3",
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 4.0.0-alpha.2 (https://www.travismclarke.com)
2+
* TableExport.js 4.0.0-alpha.3 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/

src/stable/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.

src/stable/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 4.0.0-alpha.2 (https://www.travismclarke.com)
2+
* TableExport.js 4.0.0-alpha.3 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -86,8 +86,14 @@
8686
rcMap[ir + i][ic] = 1
8787
}
8888
}
89-
if (rcMap[ir] && rcMap[ir][ic]) {
90-
return new Array(rcMap[ir][ic]).concat(val.textContent);
89+
if (rcMap[ir]) {
90+
var total = 0,
91+
min = Math.min.apply(Math, Object.keys(rcMap[ir])),
92+
max = Math.max.apply(Math, Object.keys(rcMap[ir]));
93+
while (min < max && rcMap[ir][min]) {
94+
total += rcMap[ir][min] && delete rcMap[ir][min++];
95+
}
96+
return new Array(total).concat(val.textContent);
9197
}
9298
return val.textContent;
9399
});
@@ -127,8 +133,14 @@
127133
rcMap[ir + i][ic] = 1
128134
}
129135
}
130-
if (rcMap[ir] && rcMap[ir][ic]) {
131-
return new Array(rcMap[ir][ic]).concat(val.textContent);
136+
if (rcMap[ir]) {
137+
var total = 0,
138+
min = Math.min.apply(Math, Object.keys(rcMap[ir])),
139+
max = Math.max.apply(Math, Object.keys(rcMap[ir]));
140+
while (min < max && rcMap[ir][min]) {
141+
total += rcMap[ir][min] && delete rcMap[ir][min++];
142+
}
143+
return new Array(total).concat(val.textContent);
132144
}
133145
return val.textContent;
134146
});
@@ -277,7 +289,7 @@
277289
* Version.
278290
* @memberof TableExport.prototype
279291
*/
280-
version: "4.0.0-alpha.2",
292+
version: "4.0.0-alpha.3",
281293
/**
282294
* Default plugin options.
283295
* @memberof TableExport.prototype

0 commit comments

Comments
 (0)