Allow "Add new..." button to redirect to webpages per category

main
sudoer777 2021-11-22 18:42:02 -07:00
parent 4133758bba
commit 31575212ad
2 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import * as Data from "./data.js";
const categoryDropdown = document.getElementById('category-dropdown');
const itemsListTable = document.getElementById('items-list');
const addNewButton = document.getElementById('add-new-button');
function getGenderLetter(genderName) {
@ -50,7 +51,7 @@ CATEGORIES.push(new Category(
row.appendChild(spacerCell);
},
async function addSeason() {
//
window.location.href = "manage/addseason";
},
async function editSeason() {
@ -267,7 +268,7 @@ CATEGORIES.push(new Category(
row.appendChild(dateCell);
},
async function addGame() {
//
window.location.href = "manage/addgame";
},
async function editSeason() {
@ -314,3 +315,4 @@ listItems(CATEGORIES[categoryDropdown.selectedIndex]);
categoryDropdown.onchange = () => {
listItems(CATEGORIES[categoryDropdown.selectedIndex]);
};
addNewButton.addEventListener('click', () => CATEGORIES[categoryDropdown.selectedIndex].addItem());

View File

@ -20,7 +20,7 @@ block content
div
h2#table-header
table#items-list
button Add new...
button#add-new-button Add new...
block scripts
script(src='/scripts/manage.js' type="module")