Skip to content

Commit fce05f5

Browse files
authored
Merge pull request #1078 from alfiya-udc/dragndrop
some error + numeration
2 parents 9b5c1c9 + 5404c22 commit fce05f5

File tree

1 file changed

+4
-4
lines changed
  • 2-ui/3-event-details/4-mouse-drag-and-drop

1 file changed

+4
-4
lines changed

2-ui/3-event-details/4-mouse-drag-and-drop/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ ball.onmousedown = function(event) {
156156
moveAt(event.pageX, event.pageY);
157157
}
158158
159-
// (3) move the ball on mousemove
159+
// move the ball on mousemove
160160
document.addEventListener('mousemove', onMouseMove);
161161
162-
// (4) drop the ball, remove unneeded handlers
162+
// drop the ball, remove unneeded handlers
163163
ball.onmouseup = function() {
164164
document.removeEventListener('mousemove', onMouseMove);
165165
ball.onmouseup = null;
@@ -184,7 +184,7 @@ The difference is especially noticeable if we drag the ball by its right-bottom
184184
185185
In previous examples the ball could be dropped just "anywhere" to stay. In real-life we usually take one element and drop it onto another. For instance, a file into a folder, or a user into a trash can or whatever.
186186
187-
Abstractly, we take a "draggable" element and drop it onto "droppable" element.
187+
In other words, we take a "draggable" element and drop it onto "droppable" element.
188188
189189
We need to know the target droppable at the end of Drag'n'Drop -- to do the corresponding action, and, preferably, during the dragging process, to highlight it.
190190
@@ -211,7 +211,7 @@ For instance, below are two `<div>` elements, red on top of blue. There's no way
211211
<div style="background:red" onmouseover="alert('over red!')"></div>
212212
```
213213

214-
The same with a draggable element. The ball in always on top over other elements, so events happen on it. Whatever handlers we set on lower elements, they won't work.
214+
The same with a draggable element. The ball is always on top over other elements, so events happen on it. Whatever handlers we set on lower elements, they won't work.
215215
216216
That's why the initial idea to put handlers on potential droppables doesn't work in practice. They won't run.
217217

0 commit comments

Comments
 (0)