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

Commit 7314b99

Browse files
committed
Fix #148 by running fetchPrettyColumns before postProcess
1 parent 624afd9 commit 7314b99

File tree

4 files changed

+61
-8
lines changed

4 files changed

+61
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tabletop",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"description": "**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies!",
55
"main": "src/tabletop.js",
66
"directories": {

src/tabletop.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
options.tabletop.log('Missing data for ' + this.name + ', make sure you didn\'t forget column headers');
456456
this.originalColumns = [];
457457
this.elements = [];
458-
this.onReady.call(this);
458+
this.ready();
459459
return;
460460
}
461461

@@ -487,17 +487,13 @@
487487
element.rowNumber = i + 1;
488488
}
489489

490-
if (options.postProcess) {
491-
options.postProcess(element);
492-
}
493-
494490
this.elements.push(element);
495491
}
496492

497493
if (options.prettyColumnNames) {
498494
this.fetchPrettyColumns();
499495
} else {
500-
this.onReady.call(this);
496+
this.ready();
501497
}
502498
};
503499

@@ -521,7 +517,16 @@
521517
});
522518
},
523519

520+
beforeReady: function() {
521+
if(this.postProcess) {
522+
for (i = 0, ilen = this.elements.length; i < ilen; i++) {
523+
this.postProcess(element);
524+
}
525+
}
526+
},
527+
524528
ready: function() {
529+
this.beforeReady();
525530
this.onReady.call(this);
526531
},
527532

0 commit comments

Comments
 (0)