Skip to content

done#153

Open
Neil-Gorski wants to merge 1 commit intodevmentor-pl:masterfrom
Neil-Gorski:master
Open

done#153
Neil-Gorski wants to merge 1 commit intodevmentor-pl:masterfrom
Neil-Gorski:master

Conversation

@Neil-Gorski
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.

Neil,

Zadania są ok 👍
Zostawiłem parę drobnych uwag :)

if (elCommentsItem) {
const dataInfoElements = elCommentsItem.querySelectorAll("[data-info]");
console.log(`There are ${dataInfoElements.length} emelents.`);
}
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.

👍

Comment on lines +3 to +4
const dataUrlList = document.querySelectorAll("a");
if (dataUrlList) {
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.

Jeśli wyszukujesz wiele elementów i żaden nie został odnaleziony to jest zwracana pusta tablica. Pusta tablica jest obiektem więc jest prawdą. Dlatego waki warunke nie ma sensu bo będzie zawsze prawdziwy. Można go pominać lub poprawić na coś takiego: if (dataUrlList.length > 0)

}
button.innerText = buttonSettings.text;

parentSectionBtn.appendChild(button);
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.

👍

ancherTag.href = menuItems[i].url;
ancherTag.innerText = menuItems[i].text;
unorderdList.appendChild(listItem);
}
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.

👍

// 2.
const childArr = [...curr.parentElement.children];
childArr.forEach((element) => {
if (element) {
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.

Wyszukujemy elementy więc one nigdy nie będą "fałszywe", dlatego warunek nie jest potrzeny.
Dodałbym go jednak z innego powodu. CHciałbym dodać klasę "sibling" do rodzeństwa, a nie samego siebie - trzeba curr wykluczyć.

};

const sectionArticles = curr.parentElement.parentElement;
const newArticle = createElement(articleData.article);
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.

Można też użyć cloneNode(true) - myślę, że wygodniejsze :)

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