summaryrefslogtreecommitdiff
path: root/source/features/toggle-files-button.tsx
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2022-07-05 23:26:44 +0700
committerGravatar GitHub <noreply@github.com> 2022-07-05 23:26:44 +0700
commit88e2668dbc0fbdd7c78af2747c1f022309289eea (patch)
tree92e8dbb29efd0883a57c73bc8e0427cb93cf1654 /source/features/toggle-files-button.tsx
parentf6cd9d243fdc3e5facb56085274c7cf92c4053e6 (diff)
downloadrefined-github-88e2668dbc0fbdd7c78af2747c1f022309289eea.tar.gz
refined-github-88e2668dbc0fbdd7c78af2747c1f022309289eea.tar.zst
refined-github-88e2668dbc0fbdd7c78af2747c1f022309289eea.zip
Add `has()` selector helper (#5518)
Diffstat (limited to 'source/features/toggle-files-button.tsx')
-rw-r--r--source/features/toggle-files-button.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/features/toggle-files-button.tsx b/source/features/toggle-files-button.tsx
index 46fdfa82..5be12df0 100644
--- a/source/features/toggle-files-button.tsx
+++ b/source/features/toggle-files-button.tsx
@@ -8,6 +8,7 @@ import * as pageDetect from 'github-url-detection';
import {FoldIcon, UnfoldIcon, ArrowUpIcon} from '@primer/octicons-react';
import features from '.';
+import selectHas from '../helpers/select-has';
import attachElement from '../helpers/attach-element';
import observeElement from '../helpers/simplified-element-observer';
@@ -21,7 +22,7 @@ const noticeStyle = {paddingRight: '19px'};
function addButton(): void {
attachElement({
- anchor: select('.repository-content .octicon-history')?.closest('ul'),
+ anchor: selectHas('.repository-content ul:has(.octicon-history)')!,
allowMissingAnchor: true,
className: toggleButtonClass,
position: 'append',