Skip to content

Commit cd86881

Browse files
committed
Merge pull request #11 from MrOrz/fix-tabletop
Align tabletop column processing with hackfoldr 1.0.
2 parents 5b89600 + 0480713 commit cd86881

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

views/index.jade

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,16 @@ block script
614614
Tabletop.init({
615615
key: csv_api_source_id,
616616
callback: function(data, tabletop){
617+
var columnNames = tabletop.models[tabletop.model_names[0]].column_names
617618
data = data.map(function (o) {
618-
result = [];
619-
result[0] = o.url || "";
620-
result[1] = o.title || "";
621-
result[2] = o.foldrexpand || "";
622-
result[3] = o["編輯註解"] || "";
623-
result[4] = o.hints || "";
619+
var result = ['', '', '', '', '']
620+
621+
columnNames.forEach(function(columnName, idx){
622+
if(o[columnName]) {
623+
result[idx] = o[columnName];
624+
}
625+
});
626+
624627
return result;
625628
});
626629
compile_json(data);

0 commit comments

Comments
 (0)