Skip to content
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

Update article.md #308

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

<body>

Click on a list item to select it.
Кликни на элемент списка, чтобы выделить его.
<br>

<ul id="ul">
<li>Christopher Robin</li>
<li>Winnie-the-Pooh</li>
<li>Tigger</li>
<li>Kanga</li>
<li>Rabbit. Just rabbit.</li>
<li>Кристофер Робин</li>
<li>Винни Пух</li>
<li>Тигра</li>
<li>Кенга</li>
<li>Кролик. Просто Кролик.</li>
</ul>

<script>
Expand All @@ -39,7 +39,7 @@

}

// prevent unneeded selection of list elements on clicks
// предотвращает ненужное выделение элементов списка при клике
ul.onmousedown = function() {
return false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@

<body>

Click on a list item to select it.
Кликни на элемент списка, чтобы выделить его.
<br>

<ul id="ul">
<li>Christopher Robin</li>
<li>Winnie-the-Pooh</li>
<li>Tigger</li>
<li>Kanga</li>
<li>Rabbit. Just rabbit.</li>
<li>Кристофер Робин</li>
<li>Винни Пух</li>
<li>Тигра</li>
<li>Кенга</li>
<li>Кролик. Просто Кролик.</li>
</ul>

<script>
// ...your code...
// ...ваш код...
</script>

</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ importance: 5

---

# Selectable list
# Выделяемый список

Create a list where elements are selectable, like in file-managers.
Создайте список, в котором элементы могут быть выделены, как в файловых менеджерах.

- A click on a list element selects only that element (adds the class `.selected`), deselects all others.
- If a click is made with `key:Ctrl` (`key:Cmd` for Mac), then the selection is toggled on the element, but other elements are not modified.
- При клике на элемент списка выделяет только этот элемент (добавляется класс `.selected`), отменяется выделение остальных элементов.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выделяется

- Если клик сделан вместе с `key:Ctrl` (`key:Cmd` для Mac), то выделение переключается на элементе, но остальные элементы при этом не изменяются.

The demo:
Демонстрация:

[iframe border="1" src="solution" height=180]

P.S. For this task we can assume that list items are text-only. No nested tags.
P.P.S. Prevent the native browser selection of the text on clicks.
P.S. Для этого задания можно предположить, что все элементы списка доступны только в текстовом формате. Нет вложенных тэгов.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тегов

P.P.S. Предотвратите стандартное для браузера выделение текста при клике.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

при кликах