diff options
Diffstat (limited to '')
-rw-r--r-- | source/features/cleanup-repo-filelist-actions.tsx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/features/cleanup-repo-filelist-actions.tsx b/source/features/cleanup-repo-filelist-actions.tsx index bc8dd129..a2b87f1c 100644 --- a/source/features/cleanup-repo-filelist-actions.tsx +++ b/source/features/cleanup-repo-filelist-actions.tsx @@ -5,7 +5,6 @@ import SearchIcon from 'octicon/search.svg'; import * as pageDetect from 'github-url-detection'; import features from '.'; -import {groupButtons} from '../github-helpers/group-buttons'; function init(): void { const searchButton = select('.btn[data-hotkey="t"]')!; @@ -14,16 +13,13 @@ function init(): void { searchButton.firstChild!.replaceWith(<SearchIcon/>); const addButtonWrapper = searchButton.nextElementSibling!; - const addButton = select('.btn', addButtonWrapper); - if (addButton) { - addButton.classList.add('d-md-block', 'tooltipped', 'tooltipped-ne'); - addButton.classList.remove('d-md-flex', 'ml-2'); - addButton.setAttribute('aria-label', 'Add file'); - addButton.textContent = ''; - addButton.append(<PlusIcon/>); + if (addButtonWrapper.nodeName === 'DETAILS') { + addButtonWrapper.classList.add('tooltipped', 'tooltipped-ne'); + addButtonWrapper.setAttribute('aria-label', 'Add file'); - searchButton.classList.remove('mr-2'); - groupButtons([searchButton, addButtonWrapper]); + const addIcon = select('.btn span', addButtonWrapper)!; + addIcon.classList.replace('d-md-flex', 'd-md-block'); + addIcon.firstChild!.replaceWith(<PlusIcon/>); } const downloadButton = select('get-repo details'); |