File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ async function loadMoreFiles(btn: Element): Promise<boolean> {
170170 const respFileBoxes = respDoc . querySelector ( '#diff-file-boxes' ) ;
171171 // the response is a full HTML page, we need to extract the relevant contents:
172172 // * append the newly loaded file list items to the existing list
173- document . querySelector ( '#diff-incomplete' ) . replaceWith ( ...Array . from ( respFileBoxes . children ) ) ;
173+ const respFileBoxesChildren = Array . from ( respFileBoxes . children ) ; // "children:HTMLCollection" will be empty after replaceWith
174+ document . querySelector ( '#diff-incomplete' ) . replaceWith ( ...respFileBoxesChildren ) ;
175+ for ( const el of respFileBoxesChildren ) window . htmx . process ( el ) ;
174176 onShowMoreFiles ( ) ;
175177 return true ;
176178 } catch ( error ) {
@@ -200,7 +202,7 @@ function initRepoDiffShowMore() {
200202 const resp = await response . text ( ) ;
201203 const respDoc = parseDom ( resp , 'text/html' ) ;
202204 const respFileBody = respDoc . querySelector ( '#diff-file-boxes .diff-file-body .file-body' ) ;
203- const respFileBodyChildren = Array . from ( respFileBody . children ) ; // respFileBody. children will be empty after replaceWith
205+ const respFileBodyChildren = Array . from ( respFileBody . children ) ; // " children:HTMLCollection" will be empty after replaceWith
204206 el . parentElement . replaceWith ( ...respFileBodyChildren ) ;
205207 for ( const el of respFileBodyChildren ) window . htmx . process ( el ) ;
206208 // FIXME: calling onShowMoreFiles is not quite right here.
You can’t perform that action at this time.
0 commit comments