-
Notifications
You must be signed in to change notification settings - Fork 184
DOM navigation #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
DOM navigation #328
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d1bfa37
1-js/09-classes/06-instanceof: Translation
dolgachio f976080
Merge branch 'master' of github.com:javascript-tutorial/uk.javascript…
dolgachio fba8269
1-js/10-error-handling/2-custom-errors: Translation
dolgachio 26021bc
Merge branch 'javascript-tutorial:master' into master
dolgachio f20ee14
Translate 2-ui titles
dolgachio cf87d7f
Apply suggestions from code review
tarasyyyk 7758d34
Merge branch 'javascript-tutorial:master' into master
dolgachio e407870
2-ui/1-document/03-dom-navigation: part 1
dolgachio f1c2506
2-ui/1-document/03-dom-navigation: part 2
dolgachio ced6139
2-ui/1-document/03-dom-navigation: tasks
dolgachio 6ed9194
Merge branch 'master' of github.com:stas-dolgachov/uk.javascript.info
dolgachio 539e8a1
2-ui/1-document/03-dom-navigation: 4-task translation
dolgachio b1f74dc
Apply suggestions from code review
tarasyyyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 8 additions & 8 deletions
16
2-ui/1-document/03-dom-navigation/1-dom-children/solution.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,27 @@ | ||
| There are many ways, for instance: | ||
| Існує багато способів, наприклад: | ||
|
|
||
|
|
||
| The `<div>` DOM node: | ||
| До DOM вузла `<div>`: | ||
|
|
||
| ```js | ||
| document.body.firstElementChild | ||
| // or | ||
| // або | ||
| document.body.children[0] | ||
| // or (the first node is space, so we take 2nd) | ||
| // або (перший вузол -- це пробіл, тому беремо 2-й) | ||
| document.body.childNodes[1] | ||
| ``` | ||
|
|
||
| The `<ul>` DOM node: | ||
| До DOM вузла `<ul>`: | ||
|
|
||
| ```js | ||
| document.body.lastElementChild | ||
| // or | ||
| // або | ||
| document.body.children[1] | ||
| ``` | ||
|
|
||
| The second `<li>` (with Pete): | ||
| До другого `<li>` (Петро): | ||
|
|
||
| ```js | ||
| // get <ul>, and then get its last element child | ||
| // отримати <ul>, а потім отримати його останній дочірній елемент | ||
| document.body.lastElementChild.lastElementChild | ||
| ``` |
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
8 changes: 4 additions & 4 deletions
8
2-ui/1-document/03-dom-navigation/3-navigation-links-which-null/solution.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| 1. Yes, true. The element `elem.lastChild` is always the last one, it has no `nextSibling`. | ||
| 2. No, wrong, because `elem.children[0]` is the first child *among elements*. But there may exist non-element nodes before it. So `previousSibling` may be a text node. | ||
| 1. Так, це правда. Елемент `elem.lastChild` завжди є останнім, у нього немає `nextSibling`. | ||
| 2. Ні, це неправда, тому що `elem.children[0]` є першим дочірнім *серед елементів*. Але перед ним можуть існувати вузли інших типів. Отже, `previousSibling` може бути, наприклад, текстовим вузлом. | ||
tarasyyyk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Please note: for both cases if there are no children, then there will be an error. | ||
| Зверніть увагу: в обох випадках якщо немає дітей, то буде помилка. | ||
|
|
||
| If there are no children, `elem.lastChild` is `null`, so we can't access `elem.lastChild.nextSibling`. And the collection `elem.children` is empty (like an empty array `[]`). | ||
| Якщо дочірніх елементів немає, `elem.lastChild` має значення `null`, тому ми не можемо отримати доступ до `elem.lastChild.nextSibling`. А колекція `elem.children` порожня (як порожній масив `[]`). | ||
tarasyyyk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
2 changes: 1 addition & 1 deletion
2
2-ui/1-document/03-dom-navigation/4-select-diagonal-cells/solution.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| We'll be using `rows` and `cells` properties to access diagonal table cells. | ||
| Ми будемо використовувати властивості `rows` та `cells` для доступу до діагональних клітинок таблиці. |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.