summaryrefslogtreecommitdiff
path: root/source/features/minimize-upload-bar.tsx
diff options
context:
space:
mode:
authorGravatar KennethTsang9286 <kennethtsang9286@gmail.com> 2020-11-16 11:18:42 +1100
committerGravatar GitHub <noreply@github.com> 2020-11-15 18:18:42 -0600
commitdba3b01cce565cc05a0e3f2c7ba46050d2d942b6 (patch)
tree3feb38a70bfd2079603323a4f5c5dc98924408c4 /source/features/minimize-upload-bar.tsx
parentf24c6ee9272bbafa60e9a1f8ae4de070026e81ed (diff)
downloadrefined-github-dba3b01cce565cc05a0e3f2c7ba46050d2d942b6.tar.gz
refined-github-dba3b01cce565cc05a0e3f2c7ba46050d2d942b6.tar.zst
refined-github-dba3b01cce565cc05a0e3f2c7ba46050d2d942b6.zip
Avoid duplicate upload button in 'rgh-minimize-upload-bar' (#3724)
Co-authored-by: Federico <me@fregante.com>
Diffstat (limited to 'source/features/minimize-upload-bar.tsx')
-rw-r--r--source/features/minimize-upload-bar.tsx25
1 files changed, 1 insertions, 24 deletions
diff --git a/source/features/minimize-upload-bar.tsx b/source/features/minimize-upload-bar.tsx
index a8d51bd3..73dc8cd9 100644
--- a/source/features/minimize-upload-bar.tsx
+++ b/source/features/minimize-upload-bar.tsx
@@ -1,33 +1,10 @@
import './minimize-upload-bar.css';
-import React from 'dom-chef';
-import select from 'select-dom';
-import delegate from 'delegate-it';
-import UploadIcon from 'octicon/upload.svg';
import * as pageDetect from 'github-url-detection';
import features from '.';
-function addButton(): void {
- for (const toolbarButton of select.all('md-ref')) {
- toolbarButton.after(
- <button type="button" className="toolbar-item tooltipped tooltipped-n rgh-upload-btn" aria-label="Attach files">
- <UploadIcon/>
- </button>
- );
- toolbarButton.closest('form')!.classList.add('rgh-minimize-upload-bar');
- }
-}
-
-function triggerUpload(event: delegate.Event<Event, HTMLButtonElement>): void {
- event.delegateTarget
- .form!
- .querySelector<HTMLInputElement>('[type="file"]')!
- .click(); // Open UI
-}
-
function init(): void {
- addButton();
- delegate(document, '.rgh-upload-btn', 'click', triggerUpload);
+ document.body.classList.add('rgh-minimize-upload-bar');
}
void features.add(__filebasename, {