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 model = this.model;
const components = model.get('components'); const components = model.get('components');
model.set('open', false); 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:status', this.updateStatus);
this.listenTo(model, 'change:open', this.updateOpening); this.listenTo(model, 'change:open', this.updateOpening);
this.listenTo(model, 'change:style:display', this.updateVisibility); this.listenTo(model, 'change:style:display', this.updateVisibility);
@ -277,7 +277,7 @@ module.exports = Backbone.View.extend({
* */ * */
checkChildren() { checkChildren() {
const model = this.model; const model = this.model;
const c = this.countChildren(model); const count = this.countChildren(model);
const pfx = this.pfx; const pfx = this.pfx;
const noChildCls = this.clsNoChild; const noChildCls = this.clsNoChild;
const title = this.$el const title = this.$el
@ -288,9 +288,9 @@ module.exports = Backbone.View.extend({
this.cnt = this.$el.children(`.${this.clsCount}`); this.cnt = this.$el.children(`.${this.clsCount}`);
} }
if (c) { if (count) {
title.removeClass(noChildCls); title.removeClass(noChildCls);
this.cnt.html(c); this.cnt.html(count);
} else { } else {
title.addClass(noChildCls); title.addClass(noChildCls);
this.cnt.empty(); this.cnt.empty();

Loading…
Cancel
Save