File tree 2 files changed +4
-1
lines changed 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,9 @@ function initRepoDiffShowMore() {
196
196
const resp = await response . text ( ) ;
197
197
const respDoc = parseDom ( resp , 'text/html' ) ;
198
198
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 ) ;
200
202
// FIXME: calling onShowMoreFiles is not quite right here.
201
203
// But since onShowMoreFiles mixes "init diff box" and "init diff body" together,
202
204
// 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 {
64
64
jQuery : typeof import ( '@types/jquery' ) ,
65
65
htmx : Omit < typeof import ( 'htmx.org/dist/htmx.esm.js' ) . default , 'config' > & {
66
66
config ?: Writable < typeof import ( 'htmx.org' ) . default . config > ,
67
+ process : ( elt : Element | string ) => void ,
67
68
} ,
68
69
_globalHandlerErrors : Array < ErrorEvent & PromiseRejectionEvent > & {
69
70
_inited : boolean ,
You can’t perform that action at this time.
0 commit comments