mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 04:09:29 +02:00
chore: enable no-jquery/no-trigger
- A lot of substitution to `.requestSubmit()`. - Where possible, rewrite some other jquery to vanilla javascript to ease the linter fix.
This commit is contained in:
parent
c124014115
commit
9420d3d0a5
9 changed files with 34 additions and 31 deletions
|
@ -33,25 +33,25 @@ export function initRepoArchiveLinks() {
|
|||
}
|
||||
|
||||
export function initRepoCloneLink() {
|
||||
const $repoCloneSsh = $('#repo-clone-ssh');
|
||||
const $repoCloneHttps = $('#repo-clone-https');
|
||||
const $inputLink = $('#repo-clone-url');
|
||||
const repoCloneSSH = document.getElementById('repo-clone-ssh');
|
||||
const repoCloneHTTPS = document.getElementById('repo-clone-https');
|
||||
const inputLink = document.getElementById('repo-clone-url');
|
||||
|
||||
if ((!$repoCloneSsh.length && !$repoCloneHttps.length) || !$inputLink.length) {
|
||||
if ((!repoCloneSSH && !repoCloneHTTPS) || !inputLink) {
|
||||
return;
|
||||
}
|
||||
|
||||
$repoCloneSsh.on('click', () => {
|
||||
repoCloneSSH.addEventListener('click', () => {
|
||||
localStorage.setItem('repo-clone-protocol', 'ssh');
|
||||
window.updateCloneStates();
|
||||
});
|
||||
$repoCloneHttps.on('click', () => {
|
||||
repoCloneHTTPS.addEventListener('click', () => {
|
||||
localStorage.setItem('repo-clone-protocol', 'https');
|
||||
window.updateCloneStates();
|
||||
});
|
||||
|
||||
$inputLink.on('focus', () => {
|
||||
$inputLink.trigger('select');
|
||||
inputLink.addEventListener('focus', () => {
|
||||
inputLink.select();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue