Commit 993d74e 1 parent e72b39c commit 993d74e Copy full SHA for 993d74e
File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
- import $ from 'jquery' ;
2
1
import { hideElem , showElem } from '../utils/dom.js' ;
3
2
4
3
export function initTagNameEditor ( ) {
@@ -12,18 +11,18 @@ export function initTagNameEditor() {
12
11
const newTagHelperText = el . getAttribute ( 'data-tag-helper-new' ) ;
13
12
const existingTagHelperText = el . getAttribute ( 'data-tag-helper-existing' ) ;
14
13
15
- $ ( '# tag-name') . on ( 'keyup' , ( e ) => {
14
+ document . getElementById ( ' tag-name') . addEventListener ( 'keyup' , ( e ) => {
16
15
const value = e . target . value ;
17
16
if ( existingTags . includes ( value ) ) {
18
17
// If the tag already exists, hide the target branch selector.
19
- hideElem ( $ ( '#tag-target-selector' ) ) ;
20
- $ ( '# tag-helper') . text ( existingTagHelperText ) ;
18
+ hideElem ( '#tag-target-selector' ) ;
19
+ document . getElementById ( ' tag-helper') . innerText = existingTagHelperText ;
21
20
} else {
22
- showElem ( $ ( '#tag-target-selector' ) ) ;
23
- if ( typeof value === 'string' && value . length > 0 ) {
24
- $ ( '# tag-helper') . text ( newTagHelperText ) ;
21
+ showElem ( '#tag-target-selector' ) ;
22
+ if ( value ) {
23
+ document . getElementById ( ' tag-helper') . innerText = newTagHelperText ;
25
24
} else {
26
- $ ( '# tag-helper') . text ( defaultTagHelperText ) ;
25
+ document . getElementById ( ' tag-helper') . innerText = defaultTagHelperText ;
27
26
}
28
27
}
29
28
} ) ;
You can’t perform that action at this time.
0 commit comments