From 02ad1640aac87a7e60d22487e06a4dc3ba5c23e4 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Thu, 2 Nov 2023 02:10:17 +0800 Subject: `collapsible-content-button` - Restore feature (#7021) --- source/features/collapsible-content-button.tsx | 29 ++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'source/features/collapsible-content-button.tsx') diff --git a/source/features/collapsible-content-button.tsx b/source/features/collapsible-content-button.tsx index 93fb5469..5eeae580 100644 --- a/source/features/collapsible-content-button.tsx +++ b/source/features/collapsible-content-button.tsx @@ -3,6 +3,7 @@ import {FoldDownIcon} from '@primer/octicons-react'; import * as pageDetect from 'github-url-detection'; import * as textFieldEdit from 'text-field-edit'; import delegate, {DelegateEvent} from 'delegate-it'; +import {elementExists} from 'select-dom'; import features from '../feature-manager.js'; import smartBlockWrap from '../helpers/smart-block-wrap.js'; @@ -35,15 +36,39 @@ function addContentToDetails({delegateTarget}: DelegateEvent + , ); } function init(signal: AbortSignal): void { - observe('md-ref', addButtons, {signal}); + observe([ + 'md-ref', // TODO: Drop in June 2024 + '.ActionBar-item:has([data-md-button=\'ref\'])', + ], addButtons, {signal}); delegate('.rgh-collapsible-content-btn', 'click', addContentToDetails, {signal}); } -- cgit v1.2.3