Skip to content

Commit

Permalink
Fix the count of children in Layers
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Jul 27, 2018
1 parent 853711d commit a016dfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/navigator/view/ItemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = Backbone.View.extend({
const model = this.model;
const components = model.get('components');
model.set('open', false);
this.listenTo(components, 'remove add change reset', this.checkChildren);
this.listenTo(components, 'remove add reset', this.checkChildren);
this.listenTo(model, 'change:status', this.updateStatus);
this.listenTo(model, 'change:open', this.updateOpening);
this.listenTo(model, 'change:style:display', this.updateVisibility);
Expand Down Expand Up @@ -277,7 +277,7 @@ module.exports = Backbone.View.extend({
* */
checkChildren() {
const model = this.model;
const c = this.countChildren(model);
const count = this.countChildren(model);
const pfx = this.pfx;
const noChildCls = this.clsNoChild;
const title = this.$el
Expand All @@ -288,9 +288,9 @@ module.exports = Backbone.View.extend({
this.cnt = this.$el.children(`.${this.clsCount}`);
}

if (c) {
if (count) {
title.removeClass(noChildCls);
this.cnt.html(c);
this.cnt.html(count);
} else {
title.addClass(noChildCls);
this.cnt.empty();
Expand Down

0 comments on commit a016dfd

Please sign in to comment.