File tree Expand file tree Collapse file tree
2-ui/3-event-details/4-mouse-drag-and-drop/2-drag-heroes/solution.view Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ document.addEventListener('mousedown', function(event) {
4545 moveAt ( clientX , clientY ) ;
4646 } ;
4747
48- // перемикаємося назад на абсолютні координати
49- // щоб закріпити елемент відносно документа
48+ // перемикаємося назад на абсолютні координати щоб закріпити елемент відносно документа
5049 function finishDrag ( ) {
5150 if ( ! isDragging ) {
5251 return ;
@@ -67,8 +66,7 @@ document.addEventListener('mousedown', function(event) {
6766 let newY = clientY - shiftY ;
6867
6968 // перевіряємо, чи не виходять нові координати за нижній край вікна:
70- // спочатку обчислюємо гіпотетичний новий нижній край вікна
71- let newBottom = newY + dragElement . offsetHeight ;
69+ let newBottom = newY + dragElement . offsetHeight ; // нові координати
7270
7371 // виходять за межі вікна? прокручуємо сторінку
7472 if ( newBottom > document . documentElement . clientHeight ) {
You can’t perform that action at this time.
0 commit comments