File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1- import $ from 'jquery' ;
21import { hideElem , showElem } from '../utils/dom.js' ;
32
43export function initTagNameEditor ( ) {
@@ -12,18 +11,18 @@ export function initTagNameEditor() {
1211 const newTagHelperText = el . getAttribute ( 'data-tag-helper-new' ) ;
1312 const existingTagHelperText = el . getAttribute ( 'data-tag-helper-existing' ) ;
1413
15- $ ( '# tag-name') . on ( 'keyup' , ( e ) => {
14+ document . getElementById ( ' tag-name') . addEventListener ( 'keyup' , ( e ) => {
1615 const value = e . target . value ;
1716 if ( existingTags . includes ( value ) ) {
1817 // 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 ;
2120 } 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 ;
2524 } else {
26- $ ( '# tag-helper') . text ( defaultTagHelperText ) ;
25+ document . getElementById ( ' tag-helper') . innerText = defaultTagHelperText ;
2726 }
2827 }
2928 } ) ;
You can’t perform that action at this time.
0 commit comments