Fix loose ends

Add space above footer, add better delay for height
adjustment, and add conditions to prevent errors for
websocket endpoint and no endpoint.
This commit is contained in:
hunicus 2022-03-14 14:33:41 -04:00
parent 5390a5539c
commit ba70a72f76
3 changed files with 10 additions and 10 deletions

View File

@ -188,15 +188,16 @@ h3 {
.doc-content { .doc-content {
width: 100%; width: 100%;
margin-top: -20px; margin-top: -20px;
float: unset;
} }
.endpoint-container { .endpoint-container {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
height: auto; height: auto;
transition: 0.5s height ease; transition: 0.5s height ease;
} }
.endpoint-container .section-header { .endpoint-container .section-header {
margin: 0; margin: 0;
font-size: 18px; font-size: 18px;
@ -226,9 +227,8 @@ h3 {
.hide-on-desktop { .hide-on-desktop {
display: none; display: none;
} }
h3 { h3 {
display: none; display: none;
} }
} }

View File

@ -77,9 +77,9 @@ export class ApiDocsComponent implements OnInit {
} }
this.openEndpointContainer( targetId ); this.openEndpointContainer( targetId );
} }
openEndpointContainer( targetId ) { openEndpointContainer( targetId ) {
if( window.innerWidth <= 992 ) { if( ( window.innerWidth <= 992 ) && this.restTabActivated && targetId ) {
const endpointContainerEl = document.querySelector<HTMLElement>( "#" + targetId ); const endpointContainerEl = document.querySelector<HTMLElement>( "#" + targetId );
const endpointContentEl = document.querySelector<HTMLElement>( "#" + targetId + " .endpoint-content" ); const endpointContentEl = document.querySelector<HTMLElement>( "#" + targetId + " .endpoint-content" );
const endPointContentElHeight = endpointContentEl.clientHeight; const endPointContentElHeight = endpointContentEl.clientHeight;
@ -95,7 +95,7 @@ export class ApiDocsComponent implements OnInit {
endpointContentEl.style.opacity = "1"; endpointContentEl.style.opacity = "1";
endpointContentEl.classList.add( "open" ); endpointContentEl.classList.add( "open" );
} }
} }
} }
wrapUrl(network: string, code: any, websocket: boolean = false) { wrapUrl(network: string, code: any, websocket: boolean = false) {

View File

@ -21,15 +21,15 @@ export class CodeTemplateComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.env = this.stateService.env; this.env = this.stateService.env;
} }
adjustContainerHeight( event ) { adjustContainerHeight( event ) {
if( window.innerWidth <= 992 ) { if( ( window.innerWidth <= 992 ) && ( this.method !== "websocket" ) ) {
const urlObj = new URL( window.location + "" ); const urlObj = new URL( window.location + "" );
const endpointContainerEl = document.querySelector<HTMLElement>( urlObj.hash ); const endpointContainerEl = document.querySelector<HTMLElement>( urlObj.hash );
const endpointContentEl = document.querySelector<HTMLElement>( urlObj.hash + " .endpoint-content" ); const endpointContentEl = document.querySelector<HTMLElement>( urlObj.hash + " .endpoint-content" );
window.setTimeout( function() { window.setTimeout( function() {
endpointContainerEl.style.height = endpointContentEl.clientHeight + 90 + "px"; endpointContainerEl.style.height = endpointContentEl.clientHeight + 90 + "px";
}, 400); }, 550);
} }
} }