practice-js-dom-elements tasks complete#151
Open
kacpermak1 wants to merge 6 commits intodevmentor-pl:masterfrom
Open
practice-js-dom-elements tasks complete#151kacpermak1 wants to merge 6 commits intodevmentor-pl:masterfrom
kacpermak1 wants to merge 6 commits intodevmentor-pl:masterfrom
Conversation
devmentor-pl
approved these changes
Feb 18, 2025
Owner
devmentor-pl
left a comment
There was a problem hiding this comment.
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 |
| linksWithDataUrl.forEach(link => { | ||
| const url = link.getAttribute('data-url'); | ||
| link.setAttribute('href', url); | ||
| }); No newline at end of file |
|
|
||
| const buttonSettings = { | ||
| attr: { | ||
| className: 'btn', |
Owner
There was a problem hiding this comment.
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 |
05/app.js
Outdated
Comment on lines
+4
to
+6
| if (!curr) { | ||
| console.error('.js-curr elem not found'); | ||
| } else { |
Owner
There was a problem hiding this comment.
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
devmentor-pl
approved these changes
Feb 21, 2025
| if (key === 'attr') { | ||
| for (const [attr, attrValue] of Object.entries(value)) { | ||
| element.setAttribute(attr, attrValue); | ||
| element[attr] = attrValue |
| if (!curr) { | ||
| console.error('.js-curr elem not found'); | ||
| } else { | ||
| if (curr) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.