diff options
author | 2023-11-01 12:24:19 +0800 | |
---|---|---|
committer | 2023-11-01 04:24:19 +0000 | |
commit | ae6ca57b45b4e4ad201793b8dc7f3535c43de976 (patch) | |
tree | 679608ff74b842731d0a1ce8591d2c17dd727010 /source/features/one-click-pr-or-gist.tsx | |
parent | 4a9e021202ceb76962d08d70ecab2ec9becab8d9 (diff) | |
download | refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.tar.gz refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.tar.zst refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.zip |
Meta: Use new `select-dom` API (#6992)
Diffstat (limited to 'source/features/one-click-pr-or-gist.tsx')
-rw-r--r-- | source/features/one-click-pr-or-gist.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/features/one-click-pr-or-gist.tsx b/source/features/one-click-pr-or-gist.tsx index 4b964bab..edafda1c 100644 --- a/source/features/one-click-pr-or-gist.tsx +++ b/source/features/one-click-pr-or-gist.tsx @@ -1,6 +1,6 @@ import './one-click-pr-or-gist.css'; import React from 'dom-chef'; -import select from 'select-dom'; +import {$, $$, elementExists} from 'select-dom'; import * as pageDetect from 'github-url-detection'; import features from '../feature-manager.js'; @@ -14,10 +14,10 @@ function init(): void | false { return false; } - for (const dropdownItem of select.all('.select-menu-item', initialGroupedButtons)) { - let title = select('.select-menu-item-heading', dropdownItem)!.textContent.trim(); - const description = select('.description', dropdownItem)!.textContent.trim(); - const radioButton = select('input[type=radio]', dropdownItem)!; + for (const dropdownItem of $$('.select-menu-item', initialGroupedButtons)) { + let title = $('.select-menu-item-heading', dropdownItem)!.textContent.trim(); + const description = $('.description', dropdownItem)!.textContent.trim(); + const radioButton = $('input[type=radio]', dropdownItem)!; const classList = ['btn', 'ml-2', 'tooltipped', 'tooltipped-s']; if (/\bdraft\b/i.test(title)) { @@ -49,7 +49,7 @@ void features.add(import.meta.url, { pageDetect.isGist, ], exclude: [ - () => select.exists('[data-show-dialog-id="drafts-upgrade-dialog"]'), + () => elementExists('[data-show-dialog-id="drafts-upgrade-dialog"]'), ], deduplicate: 'has-rgh', awaitDomReady: true, |