Added in ability to edit the project data item, although backend is not completed yet.
Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
@@ -11,12 +11,23 @@ document.addEventListener("DOMContentLoaded", _ =>
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Shows respective error message for form
|
||||
* @param {string} message The error message to show
|
||||
* @param {string} form The form to show the error message for
|
||||
*/
|
||||
function showErrorMessage(message, form)
|
||||
{
|
||||
document.querySelector(`#${form}Error`).classList.remove("hidden");
|
||||
document.querySelector(`#${form}Error div`).innerText = message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Switches between the different forms
|
||||
* @param {string} from The css selector of form to switch from
|
||||
* @param {string} to The css selector of form to switch to
|
||||
*/
|
||||
function switchView(from, to)
|
||||
{
|
||||
document.querySelector(from).classList.toggle("shown");
|
||||
|
||||
Reference in New Issue
Block a user