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
|
@ -37,27 +37,27 @@ export function initRepoIssueTimeTracking() {
|
|||
$('.issue-start-time-modal').modal({
|
||||
duration: 200,
|
||||
onApprove() {
|
||||
$('#add_time_manual_form').trigger('submit');
|
||||
document.getElementById('add_time_manual_form').requestSubmit();
|
||||
},
|
||||
}).modal('show');
|
||||
$('.issue-start-time-modal input').on('keydown', (e) => {
|
||||
if ((e.keyCode || e.key) === 13) {
|
||||
$('#add_time_manual_form').trigger('submit');
|
||||
document.getElementById('add_time_manual_form').requestSubmit();
|
||||
}
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.issue-start-time, .issue-stop-time', () => {
|
||||
$('#toggle_stopwatch_form').trigger('submit');
|
||||
document.getElementById('toggle_stopwatch_form').requestSubmit();
|
||||
});
|
||||
$(document).on('click', '.issue-cancel-time', () => {
|
||||
$('#cancel_stopwatch_form').trigger('submit');
|
||||
document.getElementById('cancel_stopwatch_form').requestSubmit();
|
||||
});
|
||||
$(document).on('click', 'button.issue-delete-time', function () {
|
||||
const sel = `.issue-delete-time-modal[data-id="${$(this).data('id')}"]`;
|
||||
$(sel).modal({
|
||||
duration: 200,
|
||||
onApprove() {
|
||||
$(`${sel} form`).trigger('submit');
|
||||
document.getElementById(`${sel} form`).requestSubmit();
|
||||
},
|
||||
}).modal('show');
|
||||
});
|
||||
|
@ -247,7 +247,7 @@ export function initRepoIssueDependencyDelete() {
|
|||
onApprove: () => {
|
||||
$('#removeDependencyID').val(id);
|
||||
$('#dependencyType').val(type);
|
||||
$('#removeDependencyForm').trigger('submit');
|
||||
document.getElementById('removeDependencyForm').requestSubmit();
|
||||
},
|
||||
}).modal('show');
|
||||
});
|
||||
|
@ -369,9 +369,9 @@ export function initRepoIssueWipTitle() {
|
|||
$('.title_wip_desc > a').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const $issueTitle = $('#issue_title');
|
||||
$issueTitle.trigger('focus');
|
||||
const value = $issueTitle.val().trim().toUpperCase();
|
||||
const issueTitleEl = document.getElementById('issue_title');
|
||||
issueTitleEl.focus();
|
||||
const value = issueTitleEl.value.trim().toUpperCase();
|
||||
|
||||
const wipPrefixes = $('.title_wip_desc').data('wip-prefixes');
|
||||
for (const prefix of wipPrefixes) {
|
||||
|
@ -380,7 +380,7 @@ export function initRepoIssueWipTitle() {
|
|||
}
|
||||
}
|
||||
|
||||
$issueTitle.val(`${wipPrefixes[0]} ${$issueTitle.val()}`);
|
||||
issueTitleEl.value = `${wipPrefixes[0]} ${issueTitleEl.value}`;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue