Browse Source

Fix the count of children in Layers

pull/1359/head
Artur Arseniev 8 years ago
parent
commit
a016dfd05f
  1. 8
      src/navigator/view/ItemView.js

8
src/navigator/view/ItemView.js

@ -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);
@ -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
@ -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();

Loading…
Cancel
Save