File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -516,20 +516,22 @@ export function initRepoPullRequestReview() {
516516 const $panel = $reviewBtn . parent ( ) . find ( '.review-box-panel' ) ;
517517 const $closeBtn = $panel . find ( '.close' ) ;
518518
519- const tippy = createTippy ( $reviewBtn [ 0 ] , {
520- content : $panel [ 0 ] ,
521- placement : 'bottom' ,
522- trigger : 'click' ,
523- role : 'menu' ,
524- maxWidth : 'none' ,
525- interactive : true ,
526- hideOnClick : true ,
527- } ) ;
519+ if ( $reviewBtn . length && $panel . length ) {
520+ const tippy = createTippy ( $reviewBtn [ 0 ] , {
521+ content : $panel [ 0 ] ,
522+ placement : 'bottom' ,
523+ trigger : 'click' ,
524+ role : 'menu' ,
525+ maxWidth : 'none' ,
526+ interactive : true ,
527+ hideOnClick : true ,
528+ } ) ;
528529
529- $closeBtn . on ( 'click' , ( e ) => {
530- e . preventDefault ( ) ;
531- tippy . hide ( ) ;
532- } ) ;
530+ $closeBtn . on ( 'click' , ( e ) => {
531+ e . preventDefault ( ) ;
532+ tippy . hide ( ) ;
533+ } ) ;
534+ }
533535
534536 $ ( document ) . on ( 'click' , 'a.add-code-comment' , async function ( e ) {
535537 if ( $ ( e . target ) . hasClass ( 'btn-add-single' ) ) return ; // https://github.com/go-gitea/gitea/issues/4745
You can’t perform that action at this time.
0 commit comments