Skip to content

Done#149

Open
marazmlab wants to merge 5 commits intodevmentor-pl:masterfrom
marazmlab:master
Open

Done#149
marazmlab wants to merge 5 commits intodevmentor-pl:masterfrom
marazmlab:master

Conversation

@marazmlab
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.

Marku,

Całość jest ok 👍
Zostawiłem jedynie drobną uwagę dot. zadania 01 - myślę, że to pokłosie tego, o co pytałeś na Slacku :)

Comment on lines +3 to +6
const dataInfoList = liElement.querySelectorAll('[data-info]');

if(liElement && dataInfoList) {
console.log(`Znaleziono ${dataInfoList.length} poniższe elementy z atrybutem data-info :`);
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 mamy drobny błąd logiczny - sprawdzasz czy element został wyszukany później niż go wykorzystujesz.
Powinno być:

const liElement = document.querySelector('.comments__item.comments__item--newest');
if(liElement) {
    const dataInfoList = liElement.querySelectorAll('[data-info]');
    console.log(`Znaleziono ${dataInfoList.length} poniższe elementy z atrybutem  data-info :`);
}

Nie trzeba sprawdzać dataInfoList bo to tablica elementów więc nieważne czy jest ich 0 czy więcej to błędu nie będzie.

link.setAttribute('href', url)
}
});

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.

👍


const parentButton = document.querySelector('.parent-for-button');
if (parentButton) {
parentButton.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.

👍

ul.appendChild(li);
});

nav.appendChild(ul); No newline at end of file
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.

👍

<h1 class="article__title">JS- Nowy Artykuł</h1>
<p class="article__description">Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur quo quibusdam, nemo neque consequuntur pariatur totam? Facere quaerat molestias hic.</p>
<button class="article__btn">Kupuję!</button>
`; No newline at end of file
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.

👍

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.

3 participants