|
1427 | 1427 | },
|
1428 | 1428 |
|
1429 | 1429 | // Determine action to be performed on next pointerMove and add appropriate
|
1430 |
| - // style and event Liseners |
| 1430 | + // style and event Listeners |
1431 | 1431 | pointerDown: function (pointer, event, eventTarget, curEventTarget, forceAction) {
|
1432 | 1432 | if (!forceAction && !this.inertiaStatus.active && this.pointerWasMoved && this.prepared) {
|
1433 | 1433 | this.checkAndPreventDefault(event, this.target, this.element);
|
|
2071 | 2071 | // setActiveDrops should always be called when a drag has just started or a
|
2072 | 2072 | // drag event happens while dynamicDrop is true
|
2073 | 2073 | setActiveDrops: function (dragElement) {
|
2074 |
| - // get dropzones and their elements that could recieve the draggable |
| 2074 | + // get dropzones and their elements that could receive the draggable |
2075 | 2075 | var possibleDrops = this.collectDrops(dragElement, true);
|
2076 | 2076 |
|
2077 | 2077 | this.activeDrops.dropzones = possibleDrops.dropzones;
|
|
2101 | 2101 | : null);
|
2102 | 2102 | }
|
2103 | 2103 |
|
2104 |
| - // get the most apprpriate dropzone based on DOM depth and order |
| 2104 | + // get the most appropriate dropzone based on DOM depth and order |
2105 | 2105 | var dropIndex = indexOfDeepestElement(validDrops),
|
2106 | 2106 | dropzone = this.activeDrops.dropzones[dropIndex] || null,
|
2107 | 2107 | element = this.activeDrops.elements [dropIndex] || null;
|
|
2116 | 2116 | var dragLeaveEvent = null,
|
2117 | 2117 | dragEnterEvent = null,
|
2118 | 2118 | dropActivateEvent = null,
|
2119 |
| - dropDectivateEvent = null, |
| 2119 | + dropDeactivateEvent = null, |
2120 | 2120 | dropMoveEvent = null,
|
2121 | 2121 | dropEvent = null;
|
2122 | 2122 |
|
|
2147 | 2147 | dropActivateEvent.draggable = dragEvent.interactable;
|
2148 | 2148 | }
|
2149 | 2149 | if (dragEvent.type === 'dragend') {
|
2150 |
| - dropDectivateEvent = new InteractEvent(this, pointerEvent, 'drop', 'deactivate', this.element, dragEvent.target); |
2151 |
| - dropDectivateEvent.draggable = dragEvent.interactable; |
| 2150 | + dropDeactivateEvent = new InteractEvent(this, pointerEvent, 'drop', 'deactivate', this.element, dragEvent.target); |
| 2151 | + dropDeactivateEvent.draggable = dragEvent.interactable; |
2152 | 2152 | }
|
2153 | 2153 | if (dragEvent.type === 'dragmove' && this.dropTarget) {
|
2154 | 2154 | dropMoveEvent = {
|
|
2166 | 2166 | enter : dragEnterEvent,
|
2167 | 2167 | leave : dragLeaveEvent,
|
2168 | 2168 | activate : dropActivateEvent,
|
2169 |
| - deactivate : dropDectivateEvent, |
| 2169 | + deactivate : dropDeactivateEvent, |
2170 | 2170 | move : dropMoveEvent,
|
2171 | 2171 | drop : dropEvent
|
2172 | 2172 | };
|
|
2318 | 2318 | this.pointerIds.splice(index, 1);
|
2319 | 2319 |
|
2320 | 2320 | // move events are kept so that multi-touch properties can still be
|
2321 |
| - // calculated at the end of a GestureEvnt sequence |
| 2321 | + // calculated at the end of a GestureEvent sequence |
2322 | 2322 | //this.pointers.splice(index, 1);
|
2323 | 2323 | },
|
2324 | 2324 |
|
2325 | 2325 | recordPointer: function (pointer) {
|
2326 | 2326 | // Do not update pointers while inertia is active.
|
2327 |
| - // The inertiastart event should be this.pointers[0] |
| 2327 | + // The inertia start event should be this.pointers[0] |
2328 | 2328 | if (this.inertiaStatus.active) { return; }
|
2329 | 2329 |
|
2330 | 2330 | var index = this.mouse? 0: indexOf(this.pointerIds, getPointerId(pointer));
|
|
3457 | 3457 | * Returns or sets whether elements can be dropped onto this
|
3458 | 3458 | * Interactable to trigger drop events
|
3459 | 3459 | *
|
3460 |
| - * Dropzones can recieve the following events: |
| 3460 | + * Dropzones can receive the following events: |
3461 | 3461 | * - `dragactivate` and `dragdeactivate` when an acceptable drag starts and ends
|
3462 | 3462 | * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone
|
3463 | 3463 | * - `drop` when a draggable is dropped into this dropzone
|
|
3467 | 3467 | * Use the `overlap` option to set how drops are checked for. The allowed values are:
|
3468 | 3468 | * - `'pointer'`, the pointer must be over the dropzone (default)
|
3469 | 3469 | * - `'center'`, the draggable element's center must be over the dropzone
|
3470 |
| - * - a number from 0-1 which is the `(intersetion area) / (draggable area)`. |
| 3470 | + * - a number from 0-1 which is the `(intersection area) / (draggable area)`. |
3471 | 3471 | * e.g. `0.5` for drop to happen when half of the area of the
|
3472 | 3472 | * draggable is over the dropzone
|
3473 | 3473 | *
|
|
3519 | 3519 | *
|
3520 | 3520 | - pointer (MouseEvent | PointerEvent | Touch) The event that ends a drag
|
3521 | 3521 | - draggable (Interactable) The Interactable being dragged
|
3522 |
| - - draggableElement (ELement) The actual element that's being dragged |
| 3522 | + - draggableElement (Element) The actual element that's being dragged |
3523 | 3523 | - dropElement (Element) The dropzone element
|
3524 | 3524 | - rect (object) #optional The rect of dropElement
|
3525 | 3525 | = (boolean) whether the pointer was over this Interactable
|
|
3852 | 3852 | > Usage
|
3853 | 3853 | | interact('.handle').snap({
|
3854 | 3854 | | mode : 'grid', // event coords should snap to the corners of a grid
|
3855 |
| - | range : Infinity, // the effective distance of snap ponts |
| 3855 | + | range : Infinity, // the effective distance of snap points |
3856 | 3856 | | grid : { x: 100, y: 100 }, // the x and y spacing of the grid points
|
3857 | 3857 | | gridOffset : { x: 0, y: 0 }, // the offset of the grid points
|
3858 | 3858 | | });
|
|
3959 | 3959 | | // high values slow the object down more quickly
|
3960 | 3960 | | resistance : 16,
|
3961 | 3961 | |
|
3962 |
| - | // the minimum launch speed (pixels per second) that results in inertiastart |
| 3962 | + | // the minimum launch speed (pixels per second) that results in inertia start |
3963 | 3963 | | minSpeed : 200,
|
3964 | 3964 | |
|
3965 | 3965 | | // inertia will stop when the object slows down to this speed
|
|
4491 | 4491 | * Interactable.fire
|
4492 | 4492 | [ method ]
|
4493 | 4493 | *
|
4494 |
| - * Calls listeners for the given InteractEvent type bound globablly |
| 4494 | + * Calls listeners for the given InteractEvent type bound globally |
4495 | 4495 | * and directly to this Interactable
|
4496 | 4496 | *
|
4497 | 4497 | - iEvent (InteractEvent) The InteractEvent object to be fired on this Interactable
|
|
4827 | 4827 | globalEvents[type].push(listener);
|
4828 | 4828 | }
|
4829 | 4829 | }
|
4830 |
| - // If non InteratEvent type, addEventListener to document |
| 4830 | + // If non InteractEvent type, addEventListener to document |
4831 | 4831 | else {
|
4832 | 4832 | events.add(docTarget, type, listener, useCapture);
|
4833 | 4833 | }
|
|
5026 | 5026 | };
|
5027 | 5027 | };
|
5028 | 5028 |
|
5029 |
| - // expose the functions used to caluclate multi-touch properties |
| 5029 | + // expose the functions used to calculate multi-touch properties |
5030 | 5030 | interact.getTouchAverage = touchAverage;
|
5031 | 5031 | interact.getTouchBBox = touchBBox;
|
5032 | 5032 | interact.getTouchDistance = touchDistance;
|
|
0 commit comments