Add typescript
This commit is contained in:
parent
afbfe5d850
commit
8dc72589ca
10 changed files with 1354 additions and 1742 deletions
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue