Optimize dataview rendering

This commit is contained in:
Julia Radzhabova 2018-09-18 16:22:30 +03:00
parent 088141efd9
commit aee74f91b4
3 changed files with 3 additions and 3 deletions

View file

@ -424,7 +424,7 @@ define([
innerEl.prepend(view.render().el); else
innerEl.append(view.render().el);
innerEl.find('.empty-text').remove();
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
var idx = _.indexOf(this.store.models, record);
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));

View file

@ -77,7 +77,7 @@ define([
this.innerEl = $(this.el).find('.inner');
if (view && this.innerEl) {
this.innerEl.find('.empty-text').remove();
(this.dataViewItems.length<1) && this.innerEl.find('.empty-text').remove();
if (this.options.simpleAddMode) {
this.innerEl.append(view.render().el);
this.dataViewItems.push(view);

View file

@ -195,7 +195,7 @@ define([
if (view) {
var innerEl = $(this.el).find('.inner').addBack().filter('.inner');
if (innerEl) {
innerEl.find('.empty-text').remove();
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
if (opts && opts.at!==undefined) {
var idx = opts.at;