Closed badgertastic closed 6 years ago
I ran into a similar issue and found the fix. It will be released in the next release of this repo. In the meantime, you can update the _buildAssetModel function manually. You need to add the i--
lines. Let us know if that solves your problem. Thanks.
// build asset heirarchy from flat array
_buildAssetModel: function(parentId, allAssets, level, selectedAssetId) {
for (var i=0; i<allAssets.length; i++) {
var asset = allAssets[i];
if (!asset.parentId) {
// if asset has no parent, it will never show on the context browser
allAssets.splice(i, 1);
i--; //need to move the index back after splicing.
this._buildAssetModel(parentId, allAssets, level, selectedAssetId);
}
if (asset.id === selectedAssetId) {
asset.selectedAsset = true;
}
if (asset.parentId === parentId) {
asset.children = asset.children || [];
level.push(asset);
allAssets.splice(i, 1);
i--; //need to move the index back after splicing.
// console.log('allAssets remaining', allAssets.length);
// recursive call
this._buildAssetModel(asset.id, allAssets, asset.children, selectedAssetId);
}
};
},
Yep -- thats fixed it. Big thanks @gstroup
asset-browser.html doesn't show all children.
Steps to reproduce: add additional child group(s) to groups.json:
Results inconsistent depending on how many groups added.