diff options
author | 2019-04-17 08:42:27 -0400 | |
---|---|---|
committer | 2019-04-17 20:42:27 +0800 | |
commit | 7b3b275ad9a1b1409c56310c0b8ab286bef1f75f (patch) | |
tree | 90de3c1682fbad57234cffa2e71f51baab7680c4 /source/features/upload-button.tsx | |
parent | 438f98c7d7760b5e24ebf0bd9634d0c447226196 (diff) | |
download | refined-github-7b3b275ad9a1b1409c56310c0b8ab286bef1f75f.tar.gz refined-github-7b3b275ad9a1b1409c56310c0b8ab286bef1f75f.tar.zst refined-github-7b3b275ad9a1b1409c56310c0b8ab286bef1f75f.zip |
Enable strict-mode for TypeScript (#1783)
Co-authored-by: Federico Brigante <github@bfred.it>
Diffstat (limited to 'source/features/upload-button.tsx')
-rw-r--r-- | source/features/upload-button.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/features/upload-button.tsx b/source/features/upload-button.tsx index 23f690be..6f6d2db9 100644 --- a/source/features/upload-button.tsx +++ b/source/features/upload-button.tsx @@ -1,12 +1,12 @@ import React from 'dom-chef'; import select from 'select-dom'; -import delegate from 'delegate-it'; +import delegate, {DelegateEvent} from 'delegate-it'; import features from '../libs/features'; import * as icons from '../libs/icons'; function addButtons() { for (const toolbar of select.all('form:not(.rgh-has-upload-field) markdown-toolbar')) { - const form = toolbar.closest('form'); + const form = toolbar.closest('form')!; if (!select.exists('.js-manual-file-chooser[type=file]', form)) { continue; } @@ -14,7 +14,7 @@ function addButtons() { const toolbarGroup = select('.toolbar-group:last-child', toolbar); if (toolbarGroup) { toolbarGroup.append( - <button type="button" class="toolbar-item rgh-upload-btn tooltipped tooltipped-nw" aria-label="Upload attachments" hotkey="u"> + <button type="button" className="toolbar-item rgh-upload-btn tooltipped tooltipped-nw" aria-label="Upload attachments" data-hotkey="u"> {icons.cloudUpload()} </button> ); @@ -23,10 +23,10 @@ function addButtons() { } } -function triggerUploadUI({target}) { - target - .closest('form') - .querySelector('.js-manual-file-chooser') // Find <input [type=file]> +function triggerUploadUI({target}: DelegateEvent) { + (target as Element) + .closest('form')! + .querySelector<HTMLElement>('.js-manual-file-chooser')! // Find <input [type=file]> .click(); // Open UI } |