@@ -3592,36 +3592,30 @@ function initIssueList() {
3592
3592
fullTextSearch : true
3593
3593
} ) ;
3594
3594
3595
+ function excludeLabel ( item ) {
3596
+ const href = $ ( item ) . attr ( 'href' ) ;
3597
+ const id = $ ( item ) . data ( 'label-id' ) ;
3598
+
3599
+ const regStr = `labels=((?:-?[0-9]+%2c)*)(${ id } )((?:%2c-?[0-9]+)*)&` ;
3600
+ const newStr = 'labels=$1-$2$3&' ;
3601
+
3602
+ window . location = href . replace ( new RegExp ( regStr ) , newStr ) ;
3603
+ }
3604
+
3595
3605
$ ( '.menu a.label-filter-item' ) . each ( function ( ) {
3596
3606
$ ( this ) . on ( 'click' , function ( e ) {
3597
3607
if ( e . altKey ) {
3598
3608
e . preventDefault ( ) ;
3599
-
3600
- const href = $ ( this ) . attr ( 'href' ) ;
3601
- const id = $ ( this ) . data ( 'label-id' ) ;
3602
-
3603
- const regStr = `labels=(-?[0-9]+%2c)*(${ id } )(%2c-?[0-9]+)*&` ;
3604
- const newStr = 'labels=$1-$2$3&' ;
3605
-
3606
- window . location = href . replace ( new RegExp ( regStr ) , newStr ) ;
3609
+ excludeLabel ( this ) ;
3607
3610
}
3608
3611
} ) ;
3609
3612
} ) ;
3610
3613
3611
3614
$ ( '.menu .ui.dropdown.label-filter' ) . on ( 'keydown' , ( e ) => {
3612
3615
if ( e . altKey && e . keyCode === 13 ) {
3613
3616
const selectedItems = $ ( '.menu .ui.dropdown.label-filter .menu .item.selected' ) ;
3614
-
3615
3617
if ( selectedItems . length > 0 ) {
3616
- const item = $ ( selectedItems [ 0 ] ) ;
3617
-
3618
- const href = item . attr ( 'href' ) ;
3619
- const id = item . data ( 'label-id' ) ;
3620
-
3621
- const regStr = `labels=(-?[0-9]+%2c)*(${ id } )(%2c-?[0-9]+)*&` ;
3622
- const newStr = 'labels=$1-$2$3&' ;
3623
-
3624
- window . location = href . replace ( new RegExp ( regStr ) , newStr ) ;
3618
+ excludeLabel ( $ ( selectedItems [ 0 ] ) ) ;
3625
3619
}
3626
3620
}
3627
3621
} ) ;
0 commit comments