File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,9 @@ function initRepoDiffShowMore() {
196196      const  resp  =  await  response . text ( ) ; 
197197      const  respDoc  =  parseDom ( resp ,  'text/html' ) ; 
198198      const  respFileBody  =  respDoc . querySelector ( '#diff-file-boxes .diff-file-body .file-body' ) ; 
199-       el . parentElement . replaceWith ( ...Array . from ( respFileBody . children ) ) ; 
199+       const  respFileBodyChildren  =  Array . from ( respFileBody . children ) ;  // respFileBody.children will be empty after replaceWith 
200+       el . parentElement . replaceWith ( ...respFileBodyChildren ) ; 
201+       for  ( const  el  of  respFileBodyChildren )  window . htmx . process ( el ) ; 
200202      // FIXME: calling onShowMoreFiles is not quite right here. 
201203      // But since onShowMoreFiles mixes "init diff box" and "init diff body" together, 
202204      // so it still needs to call it to make the "ImageDiff" and something similar work. 
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ interface Window {
6464  jQuery : typeof  import ( '@types/jquery' ) , 
6565  htmx : Omit < typeof  import ( 'htmx.org/dist/htmx.esm.js' ) . default ,  'config' >  &  { 
6666    config ?: Writable < typeof  import ( 'htmx.org' ) . default . config > , 
67+     process : ( elt : Element  |  string )  =>  void , 
6768  } , 
6869  _globalHandlerErrors : Array < ErrorEvent  &  PromiseRejectionEvent >  &  { 
6970    _inited : boolean , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments