Skip to content

practice-js-dom-elements#150

Open
bartoszdudziak-dev wants to merge 6 commits intodevmentor-pl:masterfrom
bartoszdudziak-dev:master
Open

practice-js-dom-elements#150
bartoszdudziak-dev wants to merge 6 commits intodevmentor-pl:masterfrom
bartoszdudziak-dev:master

Conversation

@bartoszdudziak-dev
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Owner

@devmentor-pl devmentor-pl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bartku,

Zostawiłem Ci parę drobnych uwag - poza tym ok 👍

const elementsInfoList = element.querySelectorAll(`*[data-info]`);

console.log(`Found: ${elementsInfoList.length} elements`);
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

02/app.js Outdated

const linksList = document.querySelectorAll("a[data-url]");

if (linksList) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutaj if jest niepotrzebny bo querySelectorAll zwraca obiekt "tablicopodobny", co powoduje, że to zawsze będzie prawda - obojętnie czy zostały odnalezione elementy czy nie. Jak już bardzo chcemy użyć if-a to tak: if(linksList.length > 0)

03/app.js Outdated
Comment on lines +17 to +18
button.classList.add(buttonSettings.attr.className);
button.setAttribute("title", buttonSettings.attr.title);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W przypadku attr też można użyć pętli -> button[key] = value

});

const navigationElement = document.querySelector("nav");
if (navigationElement) navigationElement.appendChild(menuElement);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

05/app.js Outdated

// 2
Array.from(curr.parentElement.children).forEach((child) =>
child.classList.add("siblings")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zwróć uwagę, że curr sam dla siebie nie jest "rodzeństwem" dlatego powinien zostać wykluczony z dodawania do niego klasy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants