We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07162c6 commit c74a439Copy full SHA for c74a439
modules/infinite-scroll/infinity.js
@@ -151,11 +151,13 @@
151
* Renders the results from a successful response.
152
*/
153
Scroller.prototype.render = function( response ) {
154
+ var childrenToAppend = Array.prototype.slice.call( response.fragment.childNodes );
155
this.body.classList.add( 'infinity-success' );
156
157
// Render the retrieved nodes.
- for ( var i = 0; i < response.fragment.childNodes.length; i++ ) {
158
- this.element.appendChild( response.fragment.childNodes[ i ] );
+ while ( childrenToAppend.length > 0 ) {
159
+ var currentNode = childrenToAppend.shift();
160
+ this.element.appendChild( currentNode );
161
}
162
163
this.trigger( this.body, 'is.post-load', {
0 commit comments