MCPcopy Create free account
hub / github.com/firebase/quickstart-js / showSection

Function showSection

database/scripts/main.ts:591–609  ·  view source on GitHub ↗

* Displays the given section element and changes styling of the given button.

(
  sectionElement?: HTMLElement,
  buttonElement?: HTMLElement,
)

Source from the content-addressed store, hash-verified

589 * Displays the given section element and changes styling of the given button.
590 */
591function showSection(
592 sectionElement?: HTMLElement,
593 buttonElement?: HTMLElement,
594) {
595 recentPostsSection.style.display = 'none';
596 userPostsSection.style.display = 'none';
597 topUserPostsSection.style.display = 'none';
598 addPost.style.display = 'none';
599 recentMenuButton.classList.remove('is-active');
600 myPostsMenuButton.classList.remove('is-active');
601 myTopPostsMenuButton.classList.remove('is-active');
602
603 if (sectionElement) {
604 sectionElement.style.display = 'block';
605 }
606 if (buttonElement) {
607 buttonElement.classList.add('is-active');
608 }
609}
610
611// Bind Sign in button.
612signInButton.addEventListener('click', function () {

Callers 1

main.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected