diff --git a/frontend/src/item-summary-block/item-summary-block-view.ts b/frontend/src/item-summary-block/item-summary-block-view.ts index c35e9b5b..3c12e8a6 100644 --- a/frontend/src/item-summary-block/item-summary-block-view.ts +++ b/frontend/src/item-summary-block/item-summary-block-view.ts @@ -1,13 +1,9 @@ -import { once, includes, extend } from 'lodash'; +import { extend } from 'lodash'; import { ViewOptions as BViewOptions } from 'backbone'; -import Model from '../core/model'; import View from '../core/view'; -import { oa } from '../common-rdf/ns'; import Node from '../common-rdf/node'; -import ldChannel from '../common-rdf/radio'; import FlatItem from '../common-adapters/flat-item-model'; -import { getCssClassName, getLabel } from '../utilities/linked-data-utilities'; import itemSummaryBlockTemplate from './item-summary-block-template'; @@ -33,11 +29,10 @@ export default class ItemSummaryBlockView extends View { this.model = new FlatItem(this.model); } if (this.model['complete']) { - this.render(); + this._startListening(); } else { - this.listenToOnce(this.model, 'complete', this.render); + this.listenToOnce(this.model, 'complete', this._startListening); } - this.listenTo(this.model, 'change:cssClass', this.updateClass); } _startListening(): void { @@ -50,11 +45,6 @@ export default class ItemSummaryBlockView extends View { render(): this { this.$el.html(this.template(this.model.attributes)); - this.updateClass(); - return this; - } - - updateClass(): this { let currentClass = this.model.get('cssClass'); if (this.setClass != currentClass) { this.$el.removeClass(this.setClass);