Skip to content

Commit

Permalink
rename div ID and variable
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Dec 13, 2022
1 parent 183b747 commit c47ccf7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<title>Odin TODO List</title>
</head>
<body>
<div id="main"></div>
<div id="cards-container"></div>
</body>
</html>
10 changes: 5 additions & 5 deletions src/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import iconTrashLid from "../media/images/icons/trash-lid.svg";
import { localStorageTest } from "./localStorageTest.js";

export const ui = (() => {
const main = document.querySelector("#main");
const cardsContainer = document.querySelector("#cards-container");

function placeCard(todo, projectIdx, todoIdx){
function placeSingleCard(todo, projectIdx, todoIdx){
const card = document.createElement("div");
card.classList.add("card");
card.dataset.priority = todo.priority;
Expand Down Expand Up @@ -162,7 +162,7 @@ export const ui = (() => {

function placeCards(projects){

main.replaceChildren()
cardsContainer.replaceChildren()


projects.forEach((project, projectIdx) => {
Expand All @@ -175,10 +175,10 @@ export const ui = (() => {
projectItem.appendChild(h1);

project.todos.forEach((todo, todoIdx) => {
projectItem.appendChild(placeCard(todo, projectIdx, todoIdx));
projectItem.appendChild(placeSingleCard(todo, projectIdx, todoIdx));
});

main.appendChild(projectItem);
cardsContainer.appendChild(projectItem);
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ input[type="text"], input[type="datetime-local"] {

body {background-color: var(--bgc-page);}

#main {
#cards-container {
box-sizing: border-box;
margin: 0;
width: 100vw;
Expand Down

0 comments on commit c47ccf7

Please sign in to comment.