Add typescript

This commit is contained in:
Anbraten 2024-10-29 11:47:39 +01:00
parent afbfe5d850
commit 8dc72589ca
No known key found for this signature in database
GPG key ID: B1222603899C6B25
10 changed files with 1354 additions and 1742 deletions

View file

@ -119,7 +119,7 @@ export function initRepoCommentForm() {
hasUpdateAction = $listMenu.data('action') === 'update'; // Update the var
const clickedItem = this; // eslint-disable-line unicorn/no-this-assignment
const clickedItem = this; // eslint-disable-line unicorn/no-this-assignment, @typescript-eslint/no-this-alias
const scope = this.getAttribute('data-scope');
$(this).parent().find('.item').each(function () {
@ -416,7 +416,10 @@ async function onEditContent(event) {
context: editContentZone.getAttribute('data-context'),
content_version: editContentZone.getAttribute('data-content-version'),
});
for (const fileInput of dropzoneInst?.element.querySelectorAll('.files [name=files]')) params.append('files[]', fileInput.value);
const files = dropzoneInst?.element?.querySelectorAll('.files [name=files]') ?? [];
for (const fileInput of files) {
params.append('files[]', fileInput.value);
}
const response = await POST(editContentZone.getAttribute('data-update-url'), {data: params});
const data = await response.json();

View file

@ -4,7 +4,7 @@ import {isDocumentFragmentOrElementNode} from '../utils/dom.js';
import octiconKebabHorizontal from '../../../public/assets/img/svg/octicon-kebab-horizontal.svg';
window.customElements.define('overflow-menu', class extends HTMLElement {
updateItems = throttle(100, () => {
updateItems = throttle(100, () => { // eslint-disable-line unicorn/consistent-function-scoping
if (!this.tippyContent) {
const div = document.createElement('div');
div.classList.add('tippy-target');