Палсеич— (lusever) wrote in changelog,
Палсеич—
lusever
changelog

[livejournal] r17632: LJSUP-7283: Comments are disappears when...

Committer: pkornilov
LJSUP-7283: Comments are disappears when click to Expand.
U   trunk/htdocs/js/thread_expander.ex.js
Modified: trunk/htdocs/js/thread_expander.ex.js
===================================================================
--- trunk/htdocs/js/thread_expander.ex.js	2010-11-03 05:20:54 UTC (rev 17631)
+++ trunk/htdocs/js/thread_expander.ex.js	2010-11-03 06:27:26 UTC (rev 17632)
@@ -103,34 +103,19 @@
 ExpanderEx.prototype.expandThread = function(json){
     this.loadingStateOff();
 
-    var fragment = document.createDocumentFragment();
-    var rowClone, row, threadId, cell, next;
+    var threadId, cell;
     for( var i = 0; i < json.length; ++i ) {
         threadId = json[ i ].thread;
         if( threadId in ExpanderEx.Collection )
             continue; //this comment is already expanded
 
-        row = jQuery('#ljcmt' + threadId );
-        rowClone = row.clone( true );
-        cell = rowClone.find( '#ljcmtxt' + threadId );
+        cell = jQuery( '#ljcmtxt' + threadId );
 
-        //remove preloader from cloned node
-        if( threadId == this.id ) {
-            cell.find('img.i-exp-preloader').remove();
-        }
-
         ExpanderEx.Collection[ threadId ] = cell.html();
         cell.replaceWith( ExpanderEx.prepareCommentBlock( json[ i ].html, threadId, false ) );
-        fragment.appendChild( rowClone[ 0 ] );
-
-        if( i == ( json.length - 1 ) ) {
-            next = row.next()[0];
-        }
-        row.remove();
     }
     //remove preloader if exist
     this.removePreloader();
-    next.parentNode.insertBefore( fragment, next );
 
     //duplicate cycle, because we do not know, that external scripts do with node
     for( var i = 0; i < json.length; ++i ) {

Tags: js, livejournal, lusever
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments