* Updates the pipe part index the user is currently dragging to. * Updates the drop handle. * @param {number} index Pipe part index
(index)
| 392 | * @param {number} index Pipe part index |
| 393 | */ |
| 394 | setDraggingPipePartIndex (index) { |
| 395 | if (this._draggingTargetIndex !== index) { |
| 396 | // Remove dragging class from current target |
| 397 | if (this._draggingTargetIndex !== null) { |
| 398 | this._$pipeParts[this._draggingTargetIndex] |
| 399 | .classList.remove('pipe__part-pipe--dragging') |
| 400 | } |
| 401 | // Update index |
| 402 | this._draggingTargetIndex = index |
| 403 | // Add dragging class on new target |
| 404 | if (index !== null) { |
| 405 | this._$pipeParts[this._draggingTargetIndex] |
| 406 | .classList.add('pipe__part-pipe--dragging') |
| 407 | this.getElement().classList.add('pipe--dragging') |
| 408 | } else { |
| 409 | this.getElement().classList.remove('pipe--dragging') |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | /** |
| 415 | * Triggered when using the mouse wheel on the view. |
no test coverage detected