diff --git a/public/scripts/index.js b/public/scripts/index.js index 6813bba..de182c7 100644 --- a/public/scripts/index.js +++ b/public/scripts/index.js @@ -1,6 +1,7 @@ import * as Data from "./data.js"; import * as Form from "./form.js"; +const dropdownsDiv = document.getElementById('dropdowns-div'); const sportDropdown = document.getElementById('sport-dropdown'); const seasonDropdown = document.getElementById('year-dropdown'); const genderDropdown = document.getElementById('gender-dropdown'); @@ -11,6 +12,7 @@ const gamesTableHeader = document.getElementById('games-table-header'); const noScoresMessage = document.getElementById('no-scores-message'); const addScoreButton = document.getElementById('add-score-button'); const manageButton = document.getElementById('manage-button'); +const loadingSpan = document.getElementById('loading'); @@ -42,6 +44,9 @@ async function initializeForm() { divisionDropdown.onchange = loadTable; teamDropdown.onchange = loadTable; + loadingSpan.textContent = ''; + dropdownsDiv.style.visibility = 'visible'; + loadTable(); diff --git a/public/stylesheets/index.css b/public/stylesheets/index.css index eb71b13..bf0a4ae 100644 --- a/public/stylesheets/index.css +++ b/public/stylesheets/index.css @@ -32,3 +32,7 @@ tr { #login-button { margin-left: auto; } + +#dropdowns-div { + visibility: hidden; +} \ No newline at end of file diff --git a/views/index.pug b/views/index.pug index a1b7d2d..1a22bbe 100644 --- a/views/index.pug +++ b/views/index.pug @@ -11,7 +11,8 @@ block actions block content - div + span#loading Loading... + div#dropdowns-div span(class='form-section') label Year span(class='form-section-input')