Browse Source

CategoryIndex: load sub categories from same repository

master
Stephan Bösch-Plepelits 7 years ago
parent
commit
91f958ae02
  1. 10
      src/CategoryIndex.js

10
src/CategoryIndex.js

@ -51,9 +51,9 @@ CategoryIndex.prototype._loadChildrenCategories = function (callback) {
this.childrenCategories[data.id] = null
if ('type' in data) {
OpenStreetBrowserLoader.getCategoryFromData(data.id, this.options, data, this._loadChildCategory.bind(this, callback))
OpenStreetBrowserLoader.getCategoryFromData(data.id, this.options, data, this._loadChildCategory.bind(this, data.id, callback))
} else {
OpenStreetBrowserLoader.getCategory(data.id, this.options, this._loadChildCategory.bind(this, callback))
OpenStreetBrowserLoader.getCategory(data.id, this.options, this._loadChildCategory.bind(this, data.id, callback))
}
}.bind(this),
function (err) {
@ -64,15 +64,15 @@ CategoryIndex.prototype._loadChildrenCategories = function (callback) {
)
}
CategoryIndex.prototype._loadChildCategory = function (callback, err, category) {
CategoryIndex.prototype._loadChildCategory = function (id, callback, err, category) {
if (err) {
return callback(err)
}
this.childrenCategories[category.id] = category
this.childrenCategories[id] = category
category.setParent(this)
category.setParentDom(this.childrenDoms[category.id])
category.setParentDom(this.childrenDoms[id])
callback(err, category)
}

Loading…
Cancel
Save