Skip to content

practice-js-dom-elements tasks complete#151

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

practice-js-dom-elements tasks complete#151
kacpermak1 wants to merge 6 commits intodevmentor-pl:masterfrom
kacpermak1:master

Conversation

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

Kacprze,

Jest ok 👍
Zostawiłem parę drobnych uwag ;)

if (commentsNewest) {
const commentsNewestWithDataInfo = commentsNewest.querySelectorAll('[data-info]');
console.log(`${commentsNewestWithDataInfo.length} elements found with data-info attribute.`);
}; 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.

👍

linksWithDataUrl.forEach(link => {
const url = link.getAttribute('data-url');
link.setAttribute('href', url);
}); 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.

👍


const buttonSettings = {
attr: {
className: 'btn',
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.

A nie da się wykorzystać className? Podobnie można zrobić jak ze stylami tj. element['className'] czy element['title'] :)

});

const nav = document.querySelector('nav');
nav.appendChild(navList); 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.

👍

05/app.js Outdated
Comment on lines +4 to +6
if (!curr) {
console.error('.js-curr elem not found');
} else {
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.

Jakoś osobiście wolę zawsze wybierać ten "normalny flow" programu, a wyjątki obsługuję potem czyli zrobiłbym raczej if(curr) {, poza tym dodawanie wykrzyknika to dodatkowa, niepotrzebna operacja - faktycznie w tym przypadku nic nie znaczy, ale może będziesz miał przypadek, w którym ta różnica będzie istotna ;P

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.

👍

if (key === 'attr') {
for (const [attr, attrValue] of Object.entries(value)) {
element.setAttribute(attr, attrValue);
element[attr] = attrValue
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.

👍

if (!curr) {
console.error('.js-curr elem not found');
} else {
if (curr) {
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.

2 participants