@@ -3753,36 +3753,30 @@ function initIssueList() {
3753
3753
fullTextSearch : true
3754
3754
} ) ;
3755
3755
3756
+ function excludeLabel ( item ) {
3757
+ const href = $ ( item ) . attr ( 'href' ) ;
3758
+ const id = $ ( item ) . data ( 'label-id' ) ;
3759
+
3760
+ const regStr = `labels=((?:-?[0-9]+%2c)*)(${ id } )((?:%2c-?[0-9]+)*)&` ;
3761
+ const newStr = 'labels=$1-$2$3&' ;
3762
+
3763
+ window . location = href . replace ( new RegExp ( regStr ) , newStr ) ;
3764
+ }
3765
+
3756
3766
$ ( '.menu a.label-filter-item' ) . each ( function ( ) {
3757
3767
$ ( this ) . on ( 'click' , function ( e ) {
3758
3768
if ( e . altKey ) {
3759
3769
e . preventDefault ( ) ;
3760
-
3761
- const href = $ ( this ) . attr ( 'href' ) ;
3762
- const id = $ ( this ) . data ( 'label-id' ) ;
3763
-
3764
- const regStr = `labels=(-?[0-9]+%2c)*(${ id } )(%2c-?[0-9]+)*&` ;
3765
- const newStr = 'labels=$1-$2$3&' ;
3766
-
3767
- window . location = href . replace ( new RegExp ( regStr ) , newStr ) ;
3770
+ excludeLabel ( this ) ;
3768
3771
}
3769
3772
} ) ;
3770
3773
} ) ;
3771
3774
3772
3775
$ ( '.menu .ui.dropdown.label-filter' ) . on ( 'keydown' , ( e ) => {
3773
3776
if ( e . altKey && e . keyCode === 13 ) {
3774
3777
const selectedItems = $ ( '.menu .ui.dropdown.label-filter .menu .item.selected' ) ;
3775
-
3776
3778
if ( selectedItems . length > 0 ) {
3777
- const item = $ ( selectedItems [ 0 ] ) ;
3778
-
3779
- const href = item . attr ( 'href' ) ;
3780
- const id = item . data ( 'label-id' ) ;
3781
-
3782
- const regStr = `labels=(-?[0-9]+%2c)*(${ id } )(%2c-?[0-9]+)*&` ;
3783
- const newStr = 'labels=$1-$2$3&' ;
3784
-
3785
- window . location = href . replace ( new RegExp ( regStr ) , newStr ) ;
3779
+ excludeLabel ( $ ( selectedItems [ 0 ] ) ) ;
3786
3780
}
3787
3781
}
3788
3782
} ) ;
0 commit comments