Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Fix #148 by running fetchPrettyColumns before postProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoma committed Sep 7, 2017
1 parent 624afd9 commit 7314b99
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tabletop",
"version": "1.5.2",
"version": "1.5.3",
"description": "**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies!",
"main": "src/tabletop.js",
"directories": {
Expand Down
17 changes: 11 additions & 6 deletions src/tabletop.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
options.tabletop.log('Missing data for ' + this.name + ', make sure you didn\'t forget column headers');
this.originalColumns = [];
this.elements = [];
this.onReady.call(this);
this.ready();
return;
}

Expand Down Expand Up @@ -487,17 +487,13 @@
element.rowNumber = i + 1;
}

if (options.postProcess) {
options.postProcess(element);
}

this.elements.push(element);
}

if (options.prettyColumnNames) {
this.fetchPrettyColumns();
} else {
this.onReady.call(this);
this.ready();
}
};

Expand All @@ -521,7 +517,16 @@
});
},

beforeReady: function() {
if(this.postProcess) {
for (i = 0, ilen = this.elements.length; i < ilen; i++) {
this.postProcess(element);
}
}
},

ready: function() {
this.beforeReady();
this.onReady.call(this);
},

Expand Down
Loading

0 comments on commit 7314b99

Please sign in to comment.