@@ -6,6 +6,7 @@ import {initEasyMDEImagePaste} from './comp/ImagePaste.js';
6
6
import { initCompMarkupContentPreviewTab } from './comp/MarkupContentPreview.js' ;
7
7
import { initTooltip , showTemporaryTooltip } from '../modules/tippy.js' ;
8
8
import { hideElem , showElem , toggleElem } from '../utils/dom.js' ;
9
+ import { setFileFolding } from './file-fold.js' ;
9
10
10
11
const { appSubUrl, csrfToken} = window . config ;
11
12
@@ -438,15 +439,20 @@ export async function handleReply($el) {
438
439
export function initRepoPullRequestReview ( ) {
439
440
if ( window . location . hash && window . location . hash . startsWith ( '#issuecomment-' ) ) {
440
441
const commentDiv = $ ( window . location . hash ) ;
442
+ console . log ( commentDiv [ 0 ] )
441
443
if ( commentDiv ) {
442
444
// get the name of the parent id
443
445
const groupID = commentDiv . closest ( 'div[id^="code-comments-"]' ) . attr ( 'id' ) ;
446
+ const ancestorDiffHeader = commentDiv . closest ( '.diff-file-box' ) . children ( '.diff-file-header' ) . eq ( 0 ) [ 0 ] ;
447
+ console . log ( ancestorDiffHeader )
448
+ setFileFolding ( ancestorDiffHeader . closest ( '.file-content' ) , ancestorDiffHeader . querySelector ( '.fold-file' ) , false ) ;
444
449
if ( groupID && groupID . startsWith ( 'code-comments-' ) ) {
445
450
const id = groupID . slice ( 14 ) ;
446
451
$ ( `#show-outdated-${ id } ` ) . addClass ( 'gt-hidden' ) ;
447
452
$ ( `#code-comments-${ id } ` ) . removeClass ( 'gt-hidden' ) ;
448
453
$ ( `#code-preview-${ id } ` ) . removeClass ( 'gt-hidden' ) ;
449
454
$ ( `#hide-outdated-${ id } ` ) . removeClass ( 'gt-hidden' ) ;
455
+ console . log ( 'scrollIntoView' )
450
456
commentDiv [ 0 ] . scrollIntoView ( ) ;
451
457
}
452
458
}
0 commit comments