File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ document . addEventListener ( 'click' , function ( ) {
2
+ function isPlaygroundEndpointButtonVisible ( ) {
3
+ const playgroundEndpoint = document . querySelector ( '.playground-endpoint .fern-button.outlined' ) ;
4
+ return playgroundEndpoint ;
5
+ }
6
+
7
+ function clickPlaygroundEndpointButton ( ) {
8
+ const playgroundEndpointButton = document . querySelector ( '.playground-endpoint .fern-button.outlined' ) ;
9
+ if ( playgroundEndpointButton ) {
10
+ playgroundEndpointButton . click ( ) ;
11
+ }
12
+ }
13
+
14
+ const fernHeaderButtons = document . querySelectorAll ( '.fern-header-container button' ) ;
15
+ fernHeaderButtons . forEach ( button => {
16
+ button . addEventListener ( 'click' , function ( ) {
17
+ if ( isPlaygroundEndpointButtonVisible ( ) ) {
18
+ clickPlaygroundEndpointButton ( ) ;
19
+ }
20
+ } ) ;
21
+ } ) ;
22
+
23
+ const fernHeaderTabs = document . querySelectorAll ( '.fern-header-container .fern-header-tab-button' ) ;
24
+ fernHeaderTabs . forEach ( button => {
25
+ button . addEventListener ( 'click' , function ( ) {
26
+ if ( isPlaygroundEndpointButtonVisible ( ) ) {
27
+ clickPlaygroundEndpointButton ( ) ;
28
+ }
29
+ } ) ;
30
+ } ) ;
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments