Add loading message to manage page
parent
7ec36ed7f2
commit
42ac77ec6f
|
@ -3,6 +3,7 @@ import * as Data from "./data.js";
|
||||||
const categoryDropdown = document.getElementById('category-dropdown');
|
const categoryDropdown = document.getElementById('category-dropdown');
|
||||||
const itemsListTable = document.getElementById('items-list');
|
const itemsListTable = document.getElementById('items-list');
|
||||||
const addNewButton = document.getElementById('add-new-button');
|
const addNewButton = document.getElementById('add-new-button');
|
||||||
|
const loadingSpan = document.getElementById('loading-message');
|
||||||
|
|
||||||
|
|
||||||
function getGenderLetter(genderName) {
|
function getGenderLetter(genderName) {
|
||||||
|
@ -362,6 +363,8 @@ CATEGORIES.push(new Category(
|
||||||
|
|
||||||
|
|
||||||
async function listItems(category) {
|
async function listItems(category) {
|
||||||
|
loadingSpan.textContent = "Loading...";
|
||||||
|
|
||||||
itemsListTable.innerHTML = "";
|
itemsListTable.innerHTML = "";
|
||||||
|
|
||||||
const itemsList = await category.getItems();
|
const itemsList = await category.getItems();
|
||||||
|
@ -389,6 +392,8 @@ async function listItems(category) {
|
||||||
|
|
||||||
itemsListTable.appendChild(row);
|
itemsListTable.appendChild(row);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
loadingSpan.textContent = '';
|
||||||
}
|
}
|
||||||
if(window.location.hash) {
|
if(window.location.hash) {
|
||||||
let correctIndex;
|
let correctIndex;
|
||||||
|
|
|
@ -18,6 +18,7 @@ block content
|
||||||
option(value="accounts") Accounts
|
option(value="accounts") Accounts
|
||||||
div
|
div
|
||||||
h2#table-header
|
h2#table-header
|
||||||
|
span#loading-message Loading...
|
||||||
table#items-list
|
table#items-list
|
||||||
button#add-new-button Add new...
|
button#add-new-button Add new...
|
||||||
|
|
||||||
|
|
Reference in New Issue