@@ -6,23 +6,23 @@ function isExclusiveScopeName(name) {
66}
77
88function updateExclusiveLabelEdit ( form ) {
9- const nameInput = $ ( `${ form } .label-name-input` ) ;
10- const exclusiveField = $ ( `${ form } .label-exclusive-input-field` ) ;
11- const exclusiveCheckbox = $ ( `${ form } .label-exclusive-input` ) ;
12- const exclusiveWarning = $ ( `${ form } .label-exclusive-warning` ) ;
9+ const $ nameInput = $ ( `${ form } .label-name-input` ) ;
10+ const $ exclusiveField = $ ( `${ form } .label-exclusive-input-field` ) ;
11+ const $ exclusiveCheckbox = $ ( `${ form } .label-exclusive-input` ) ;
12+ const $ exclusiveWarning = $ ( `${ form } .label-exclusive-warning` ) ;
1313
14- if ( isExclusiveScopeName ( nameInput . val ( ) ) ) {
15- exclusiveField . removeClass ( 'muted' ) ;
16- exclusiveField . removeAttr ( 'aria-disabled' ) ;
17- if ( exclusiveCheckbox . prop ( 'checked' ) && exclusiveCheckbox . data ( 'exclusive-warn' ) ) {
18- exclusiveWarning . removeClass ( 'gt-hidden' ) ;
14+ if ( isExclusiveScopeName ( $ nameInput. val ( ) ) ) {
15+ $ exclusiveField. removeClass ( 'muted' ) ;
16+ $ exclusiveField. removeAttr ( 'aria-disabled' ) ;
17+ if ( $ exclusiveCheckbox. prop ( 'checked' ) && $ exclusiveCheckbox. data ( 'exclusive-warn' ) ) {
18+ $ exclusiveWarning. removeClass ( 'gt-hidden' ) ;
1919 } else {
20- exclusiveWarning . addClass ( 'gt-hidden' ) ;
20+ $ exclusiveWarning. addClass ( 'gt-hidden' ) ;
2121 }
2222 } else {
23- exclusiveField . addClass ( 'muted' ) ;
24- exclusiveField . attr ( 'aria-disabled' , 'true' ) ;
25- exclusiveWarning . addClass ( 'gt-hidden' ) ;
23+ $ exclusiveField. addClass ( 'muted' ) ;
24+ $ exclusiveField. attr ( 'aria-disabled' , 'true' ) ;
25+ $ exclusiveWarning. addClass ( 'gt-hidden' ) ;
2626 }
2727}
2828
@@ -46,18 +46,18 @@ export function initCompLabelEdit(selector) {
4646 $ ( '.edit-label .color-picker' ) . minicolors ( 'value' , $ ( this ) . data ( 'color' ) ) ;
4747 $ ( '#label-modal-id' ) . val ( $ ( this ) . data ( 'id' ) ) ;
4848
49- const nameInput = $ ( '.edit-label .label-name-input' ) ;
50- nameInput . val ( $ ( this ) . data ( 'title' ) ) ;
49+ const $ nameInput = $ ( '.edit-label .label-name-input' ) ;
50+ $ nameInput. val ( $ ( this ) . data ( 'title' ) ) ;
5151
52- const isArchivedCheckbox = $ ( '.edit-label .label-is-archived-input' ) ;
53- isArchivedCheckbox . prop ( 'checked' , this . hasAttribute ( 'data-is-archived' ) ) ;
52+ const $ isArchivedCheckbox = $ ( '.edit-label .label-is-archived-input' ) ;
53+ $ isArchivedCheckbox. prop ( 'checked' , this . hasAttribute ( 'data-is-archived' ) ) ;
5454
55- const exclusiveCheckbox = $ ( '.edit-label .label-exclusive-input' ) ;
56- exclusiveCheckbox . prop ( 'checked' , this . hasAttribute ( 'data-exclusive' ) ) ;
55+ const $ exclusiveCheckbox = $ ( '.edit-label .label-exclusive-input' ) ;
56+ $ exclusiveCheckbox. prop ( 'checked' , this . hasAttribute ( 'data-exclusive' ) ) ;
5757 // Warn when label was previously not exclusive and used in issues
58- exclusiveCheckbox . data ( 'exclusive-warn' ,
58+ $ exclusiveCheckbox. data ( 'exclusive-warn' ,
5959 $ ( this ) . data ( 'num-issues' ) > 0 &&
60- ( ! this . hasAttribute ( 'data-exclusive' ) || ! isExclusiveScopeName ( nameInput . val ( ) ) ) ) ;
60+ ( ! this . hasAttribute ( 'data-exclusive' ) || ! isExclusiveScopeName ( $ nameInput. val ( ) ) ) ) ;
6161 updateExclusiveLabelEdit ( '.edit-label' ) ;
6262
6363 $ ( '.edit-label .label-desc-input' ) . val ( $ ( this ) . data ( 'description' ) ) ;
0 commit comments