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 @@ -515,20 +515,22 @@ export function initRepoPullRequestReview() {
515515 const $panel = $reviewBtn . parent ( ) . find ( '.review-box-panel' ) ;
516516 const $closeBtn = $panel . find ( '.close' ) ;
517517
518- const tippy = createTippy ( $reviewBtn [ 0 ] , {
519- content : $panel [ 0 ] ,
520- placement : 'bottom' ,
521- trigger : 'click' ,
522- role : 'menu' ,
523- maxWidth : 'none' ,
524- interactive : true ,
525- hideOnClick : true ,
526- } ) ;
518+ if ( $reviewBtn . length && $panel . length ) {
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+ } ) ;
527528
528- $closeBtn . on ( 'click' , ( e ) => {
529- e . preventDefault ( ) ;
530- tippy . hide ( ) ;
531- } ) ;
529+ $closeBtn . on ( 'click' , ( e ) => {
530+ e . preventDefault ( ) ;
531+ tippy . hide ( ) ;
532+ } ) ;
533+ }
532534
533535 $ ( document ) . on ( 'click' , 'a.add-code-comment' , async function ( e ) {
534536 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