Skip to content

Commit

Permalink
Bumping to v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Intellipharm committed May 5, 2015
1 parent 16e1250 commit 63c6861
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-file",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/Intellipharm/js-file",
"authors": [
"Intellipharm <damian@intellipharm.com.au>",
Expand Down
22 changes: 13 additions & 9 deletions dist/js-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ window.JSFile = window.JSFile || {};
* @returns {Array}
*/
this.transformWorksheetHeadersArray = function(headers) {
var temp = _.cloneDeep(headers);

_.forEach(headers, function (row, row_index) {
var column_index_offset = 0;

_.forEach(row, function (column, column_index) {

// add rows
Expand All @@ -227,17 +230,17 @@ window.JSFile = window.JSFile || {};
var next_row = row_index + row_count;

// create next row if does not exist
if (!_.has(headers, next_row)) {
headers[next_row] = [];
if (!_.has(temp, next_row)) {
temp[next_row] = [];

// create next row columns
for (var i = 0; i < column_index; i++) {
headers[next_row].push({});
for (var i = 0; i < column_index + column_index_offset; i++) {
temp[next_row].push({});
}
}

// splice into next row
headers[next_row].splice(column_index, 0, {});
temp[next_row].splice(column_index + column_index_offset, 0, {});
}
}

Expand All @@ -246,16 +249,17 @@ window.JSFile = window.JSFile || {};

for (var column_count = 1; column_count < column.colspan; column_count++) {

var next_column = column_index + column_count;

var next_column = column_index + column_index_offset + column_count;
// splice into next column
headers[row_index].splice(next_column, 0, {});
temp[row_index].splice(next_column, 0, {});
}

column_index_offset += column.colspan - 1;
}
});
});

return headers;
return temp;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/js-file.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js-file.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-file",
"version": "0.1.2",
"version": "0.1.3",
"dependencies": {},
"devDependencies": {
"glob": "~5.0.0",
Expand Down

0 comments on commit 63c6861

Please sign in to comment.