|
|
|
@ -274,16 +274,10 @@ module.exports = Backbone.View.extend({ |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
renderClasses() { |
|
|
|
var fragment = document.createDocumentFragment(); |
|
|
|
|
|
|
|
this.collection.each(function(model) { |
|
|
|
this.addToClasses(model, fragment); |
|
|
|
}, this); |
|
|
|
|
|
|
|
if (this.getClasses()) |
|
|
|
this.getClasses() |
|
|
|
.empty() |
|
|
|
.append(fragment); |
|
|
|
const frag = document.createDocumentFragment(); |
|
|
|
const classes = this.getClasses(); |
|
|
|
this.collection.each(model => this.addToClasses(model, frag)); |
|
|
|
classes.get(0) && classes.empty().append(frag); |
|
|
|
|
|
|
|
return this; |
|
|
|
}, |
|
|
|
@ -294,8 +288,7 @@ module.exports = Backbone.View.extend({ |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
getClasses() { |
|
|
|
if (!this.$classes) |
|
|
|
this.$classes = this.$el.find('#' + this.pfx + 'tags-c'); |
|
|
|
if (!this.$classes) this.$classes = this.$el.find(`#${this.pfx}tags-c`); |
|
|
|
return this.$classes; |
|
|
|
}, |
|
|
|
|
|
|
|
|