mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user