We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c40ee6f commit 236e121Copy full SHA for 236e121
web_src/js/features/sshkey-helper.js
@@ -1,12 +1,10 @@
1
-import $ from 'jquery';
2
-
3
export function initSshKeyFormParser() {
4
-// Parse SSH Key
5
- $('#ssh-key-content').on('change paste keyup', function () {
6
- const arrays = $(this).val().split(' ');
7
- const $title = $('#ssh-key-title');
8
- if ($title.val() === '' && arrays.length === 3 && arrays[2] !== '') {
9
- $title.val(arrays[2]);
+ // Parse SSH Key
+ document.getElementById('ssh-key-content')?.addEventListener('input', function () {
+ const arrays = this.value.split(' ');
+ const title = document.getElementById('ssh-key-title');
+ if (!title.value && arrays.length === 3 && arrays[2] !== '') {
+ title.value = arrays[2];
10
}
11
});
12
0 commit comments