-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
449 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
// Handles category to edit selection | ||
function loadCategoryInfo() { | ||
// Get selected category | ||
const categoryId = document.getElementById('category_id').value | ||
const categoryId = document.getElementById("category_id").value; | ||
|
||
// Reset form if category deselected | ||
if (categoryId === '') { | ||
document.getElementById('admin_edit_category').reset() | ||
return | ||
if (categoryId === "") { | ||
document.getElementById("admin_edit_category").reset(); | ||
return; | ||
} | ||
|
||
// Name | ||
document.getElementById('category_name').value = | ||
json_data[categoryId].category_name | ||
document.getElementById("category_name").value = | ||
json_data[categoryId].category_name; | ||
|
||
// Color | ||
document.getElementById('category_color').value = | ||
json_data[categoryId].category_color | ||
document.getElementById("category_color").value = | ||
json_data[categoryId].category_color; | ||
|
||
// Disable | ||
document.getElementById('category_disabled').checked = | ||
json_data[categoryId].category_disabled | ||
document.getElementById("category_disabled").checked = | ||
json_data[categoryId].category_disabled; | ||
} | ||
|
||
// document.addEventListener('DOMContentLoaded', function () { | ||
// // Load image when browser navigates back to this page | ||
// if (document.getElementById('category_id').value) { | ||
// loadCategoryInfo() | ||
// } | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.