From e93d050d6f981daacc764aa43e131ff0f617331f Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Mon, 14 Nov 2011 20:00:40 +0000 Subject: [PATCH] Only re-render nodes that were inserted --- modules/es/bases/es.DocumentViewBranchNode.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/es/bases/es.DocumentViewBranchNode.js b/modules/es/bases/es.DocumentViewBranchNode.js index 9ea5a59364..632c102d52 100644 --- a/modules/es/bases/es.DocumentViewBranchNode.js +++ b/modules/es/bases/es.DocumentViewBranchNode.js @@ -69,7 +69,7 @@ es.DocumentViewBranchNode.prototype.onAfterUnshift = function( childModel ) { this.$.prepend( childView.$ ); this.emit( 'afterUnshift', childView ); this.emit( 'update' ); - this.renderContent(); + childView.renderContent(); }; es.DocumentViewBranchNode.prototype.onAfterPop = function() { @@ -82,7 +82,7 @@ es.DocumentViewBranchNode.prototype.onAfterPop = function() { childView.$.detach(); this.emit( 'afterPop' ); this.emit( 'update' ); - this.renderContent(); + childView.renderContent(); }; es.DocumentViewBranchNode.prototype.onAfterShift = function() { @@ -95,7 +95,7 @@ es.DocumentViewBranchNode.prototype.onAfterShift = function() { childView.$.detach(); this.emit( 'afterShift' ); this.emit( 'update' ); - this.renderContent(); + childView.renderContent(); }; es.DocumentViewBranchNode.prototype.onAfterSplice = function( index, howmany ) { @@ -132,7 +132,11 @@ es.DocumentViewBranchNode.prototype.onAfterSplice = function( index, howmany ) { } } this.emit.apply( this, ['afterSplice'].concat( args ) ); - this.renderContent(); + if ( args.length >= 3 ) { + for ( i = 2, length = args.length; i < length; i++ ) { + args[i] = args[i].renderContent(); + } + } }; es.DocumentViewBranchNode.prototype.onAfterSort = function() {