@@ -15,7 +15,7 @@ const {appSubUrl} = window.config;
1515/**
1616 * @param {HTMLElement } item
1717 */
18- function excludeLabel ( item ) {
18+ function excludeLabel ( item : Element ) {
1919 const href = item . getAttribute ( 'href' ) ;
2020 const id = item . getAttribute ( 'data-label-id' ) ;
2121
@@ -80,7 +80,7 @@ export function initRepoIssueLabelFilter() {
8080
8181export function initRepoIssueCommentDelete ( ) {
8282 // Delete comment
83- document . addEventListener ( 'click' , async ( e ) => {
83+ document . addEventListener ( 'click' , async ( e : MouseEvent & { target : HTMLElement } ) => {
8484 if ( ! e . target . matches ( '.delete-comment' ) ) return ;
8585 e . preventDefault ( ) ;
8686
@@ -155,7 +155,7 @@ export function initRepoIssueDependencyDelete() {
155155
156156export function initRepoIssueCodeCommentCancel ( ) {
157157 // Cancel inline code comment
158- document . addEventListener ( 'click' , ( e ) => {
158+ document . addEventListener ( 'click' , ( e : MouseEvent & { target : HTMLElement } ) => {
159159 if ( ! e . target . matches ( '.cancel-code-comment' ) ) return ;
160160
161161 const form = e . target . closest ( 'form' ) ;
@@ -294,7 +294,7 @@ export function initRepoIssueWipTitle() {
294294export function initRepoIssueComments ( ) {
295295 if ( ! $ ( '.repository.view.issue .timeline' ) . length ) return ;
296296
297- document . addEventListener ( 'click' , ( e ) => {
297+ document . addEventListener ( 'click' , ( e : MouseEvent & { target : HTMLElement } ) => {
298298 const urlTarget = document . querySelector ( ':target' ) ;
299299 if ( ! urlTarget ) return ;
300300
@@ -446,7 +446,7 @@ export function initRepoPullRequestReview() {
446446
447447export function initRepoIssueReferenceIssue ( ) {
448448 // Reference issue
449- $ ( document ) . on ( 'click' , '.reference-issue' , function ( event ) {
449+ $ ( document ) . on ( 'click' , '.reference-issue' , function ( e ) {
450450 const target = this . getAttribute ( 'data-target' ) ;
451451 const content = document . querySelector ( `#${ target } ` ) ?. textContent ?? '' ;
452452 const poster = this . getAttribute ( 'data-poster-username' ) ;
@@ -456,7 +456,7 @@ export function initRepoIssueReferenceIssue() {
456456 const textarea = modal . querySelector ( 'textarea[name="content"]' ) ;
457457 textarea . value = `${ content } \n\n_Originally posted by @${ poster } in ${ reference } _` ;
458458 $ ( modal ) . modal ( 'show' ) ;
459- event . preventDefault ( ) ;
459+ e . preventDefault ( ) ;
460460 } ) ;
461461}
462462
@@ -540,7 +540,7 @@ export function initRepoIssueTitleEdit() {
540540}
541541
542542export function initRepoIssueBranchSelect ( ) {
543- document . querySelector ( '#branch-select' ) ?. addEventListener ( 'click' , ( e ) => {
543+ document . querySelector ( '#branch-select' ) ?. addEventListener ( 'click' , ( e : MouseEvent & { target : HTMLElement } ) => {
544544 const el = e . target . closest ( '.item[data-branch]' ) ;
545545 if ( ! el ) return ;
546546 const pullTargetBranch = document . querySelector ( '#pull-target-branch' ) ;
0 commit comments