changed a bunch of whitespace back into tabs, and fixed issue where categories without a parentCid were not showing up at all in the ACP

This commit is contained in:
Julian Lam
2015-06-04 14:24:33 -04:00
parent e892cf2e51
commit 6fedcca4ee
4 changed files with 58 additions and 56 deletions

View File

@@ -319,16 +319,19 @@ var async = require('async'),
Categories.getTree = function(categories, parentCid) {
var tree = [], i = 0, len = categories.length, category;
for(i; i < len; ++i){
category = categories[i];
for(i; i < len; ++i) {
category = categories[i];
if (!category.hasOwnProperty('parentCid')) {
category.parentCid = 0;
}
if(category.parentCid == parentCid){
tree.push(category);
category.children = Categories.getTree(categories, category.cid);
}
}
if(category.parentCid == parentCid){
tree.push(category);
category.children = Categories.getTree(categories, category.cid);
}
}
return tree;
return tree;
};
}(exports));