Browse Source

CategoryIndex: move loading sub categories to separate function

master
parent
commit
a9957670eb
  1. 20
      src/CategoryIndex.js

20
src/CategoryIndex.js

@ -21,6 +21,18 @@ CategoryIndex.prototype.open = function () {
return
}
this._loadChildrenCategories()
}
CategoryIndex.prototype.recalc = function () {
for (var k in this.childrenCategories) {
if (this.childrenCategories[k]) {
this.childrenCategories[k].recalc()
}
}
}
CategoryIndex.prototype._loadChildrenCategories = function () {
this.childrenCategories = {}
for (var i = 0; i < this.data.subCategories.length; i++) {
@ -40,14 +52,6 @@ CategoryIndex.prototype.open = function () {
}
}
CategoryIndex.prototype.recalc = function () {
for (var k in this.childrenCategories) {
if (this.childrenCategories[k]) {
this.childrenCategories[k].recalc()
}
}
}
CategoryIndex.prototype._loadChildCategory = function (err, category) {
if (err) {
return

Loading…
Cancel
Save