diff --git a/frontend/src/app/components/docs/api-docs.component.ts b/frontend/src/app/components/docs/api-docs.component.ts index e40148f14..42ea7f80c 100644 --- a/frontend/src/app/components/docs/api-docs.component.ts +++ b/frontend/src/app/components/docs/api-docs.component.ts @@ -79,27 +79,23 @@ export class ApiDocsComponent implements OnInit { } openEndpointContainer( targetId ) { - - if( window.innerWidth > 992 ) { - return; - } - - const endpointContainerEl = document.querySelector( "#" + targetId ); - const endpointContentEl = document.querySelector( "#" + targetId + " .endpoint-content" ); - const endPointContentElHeight = endpointContentEl.clientHeight; + if( window.innerWidth <= 992 ) { + const endpointContainerEl = document.querySelector( "#" + targetId ); + const endpointContentEl = document.querySelector( "#" + targetId + " .endpoint-content" ); + const endPointContentElHeight = endpointContentEl.clientHeight; - if( endpointContentEl.classList.contains( "open" ) ) { - endpointContainerEl.style.height = "auto"; - endpointContentEl.style.top = "-10000px"; - endpointContentEl.style.opacity = "0"; - endpointContentEl.classList.remove( "open" ); - } else { - endpointContainerEl.style.height = endPointContentElHeight + 90 + "px"; - endpointContentEl.style.top = "90px"; - endpointContentEl.style.opacity = "1"; - endpointContentEl.classList.add( "open" ); - } - + if( endpointContentEl.classList.contains( "open" ) ) { + endpointContainerEl.style.height = "auto"; + endpointContentEl.style.top = "-10000px"; + endpointContentEl.style.opacity = "0"; + endpointContentEl.classList.remove( "open" ); + } else { + endpointContainerEl.style.height = endPointContentElHeight + 90 + "px"; + endpointContentEl.style.top = "90px"; + endpointContentEl.style.opacity = "1"; + endpointContentEl.classList.add( "open" ); + } + } } wrapUrl(network: string, code: any, websocket: boolean = false) { diff --git a/frontend/src/app/components/docs/code-template.component.html b/frontend/src/app/components/docs/code-template.component.html index a3b8c4791..f1cf3a1cc 100644 --- a/frontend/src/app/components/docs/code-template.component.html +++ b/frontend/src/app/components/docs/code-template.component.html @@ -1,14 +1,14 @@