Browser default actions by OlhaBrozhenets · Pull Request #264 · javascript-tutorial/uk.javascript.info
12 changes: 6 additions & 6 deletions
2-ui/2-events/04-default-browser-action/1-why-return-false-fails/solution.md
10 changes: 5 additions & 5 deletions
2-ui/2-events/04-default-browser-action/1-why-return-false-fails/task.md
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| That's a great use of the event delegation pattern. | ||
| Це чудове використання шаблону делегування подій. | ||
|
|
||
| In real life instead of asking we can send a "logging" request to the server that saves the information about where the visitor left. Or we can load the content and show it right in the page (if allowable). | ||
| У реальному житті замість того, щоб запитувати, ми можемо надіслати запит на «реєстрацію» на сервер, який зберігає інформацію про те, куди пішов відвідувач. Або ми можемо завантажити вміст і показати його прямо на сторінці (якщо це дозволено). | ||
|
|
||
| All we need is to catch the `contents.onclick` and use `confirm` to ask the user. A good idea would be to use `link.getAttribute('href')` instead of `link.href` for the URL. See the solution for details. | ||
| Все, що нам потрібно, це зловити `contents.onclick` і використати `confirm`, щоб запитати користувача. Хорошою ідеєю було б використовувати `link.getAttribute('href')` замість `link.href` для URL-адреси. Подробиці дивіться у рішенні. |
12 changes: 6 additions & 6 deletions
2-ui/2-events/04-default-browser-action/2-catch-link-navigation/task.md
2 changes: 1 addition & 1 deletion
2-ui/2-events/04-default-browser-action/3-image-gallery/solution.md
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| The solution is to assign the handler to the container and track clicks. If a click is on the `<a>` link, then change `src` of `#largeImg` to the `href` of the thumbnail. | ||
| Рішення полягає в тому, щоб призначити обробник контейнеру та відстежувати кліки. Якщо клік відбувається на посилання `<a>`, змініть `src` для `#largeImg` на `href` мініатюри. |
8 changes: 4 additions & 4 deletions
2-ui/2-events/04-default-browser-action/3-image-gallery/task.md