1 | ## v1.3.2
|
2 | - fixed issues with action options ([PR
|
3 | #567](https://github.com/taye/interact.js/pull/567), [issue
|
4 | #570](https://github.com/taye/interact.js/issues/570))
|
5 |
|
6 | ## v1.3.1
|
7 | - fixed iOS preventDefault passive event issue ([issue
|
8 | #561](https://github.com/taye/interact.js/issues/561))
|
9 |
|
10 | ## v1.3.1
|
11 | - allowed calling `draggable.unset()` during `dragend` and `drop` event
|
12 | listeners ([issue #560](https://github.com/taye/interact.js/issues/560))
|
13 | - allowed snap to be enabled with falsey targets value [issue
|
14 | #562](https://github.com/taye/interact.js/issues/562)
|
15 |
|
16 | ## v1.3.0
|
17 |
|
18 | Most notably:
|
19 |
|
20 | - changed the npm and bower package names to "interactjs" ([issue
|
21 | #399](https://github.com/taye/interact.js/issues/399)
|
22 | - major refactor with [PR #231](https://github.com/taye/interact.js/pull/231).
|
23 | - removed deprecated methods:
|
24 | - `Interactable`: `squareResize`, `snap`, `restrict`, `inertia`,
|
25 | `autoScroll`, `accept`
|
26 | - `interact`: `enabbleDragging`, `enableResizing`, `enableGesturing`,
|
27 | `margin`
|
28 | - new `hold` option for starting actions
|
29 | - new `interaction.end()` method
|
30 | ([df963b0](https://github.com/taye/interact.js/commit/df963b0))
|
31 | - `snap.offset` `self` option ([issue
|
32 | #204](https://github.com/taye/interact.js/issues/204/#issuecomment-154879052))
|
33 | - `interaction.doMove()`
|
34 | ([3489ee1](https://github.com/taye/interact.js/commit/3489ee1))
|
35 | ([c5c658a](https://github.com/taye/interact.js/commit/c5c658a))
|
36 | - snap grid limits
|
37 | ([d549672](https://github.com/taye/interact.js/commit/d549672))
|
38 | - improved iframe support ([PR
|
39 | #313](https://github.com/taye/interact.js/pull/313))
|
40 | - `actionend` event dx/dy are now `0`, not the difference between start and
|
41 | end coords ([cbfaf00](https://github.com/taye/interact.js/commit/cbfaf00))
|
42 | - replaced drag `axis` option with `startAxis` and `lockAxis`
|
43 | - added pointerEvents options:
|
44 | - `holdDuration`
|
45 | ([1c58f92](https://github.com/taye/interact.js/commit/1c58f927)),
|
46 | - `ignoreFrom` and `allowFrom`
|
47 | ([6cbaad6](https://github.com/taye/interact.js/commit/6cbaad6d))
|
48 | - `origin` ([7823bb9](https://github.com/taye/interact.js/commit/7823bb95))
|
49 | - action events set with action method options (eg.
|
50 | `target.draggable({onmove})` are removed when that action is disabled with a
|
51 | method call ([cca4e26](https://github.com/taye/interact.js/commit/cca4e260))
|
52 | - `context` option now works for Element targets
|
53 | ([8f64a7a](https://github.com/taye/interact.js/commit/8f64a7a4))
|
54 | - added an action `mouseButtons` option and allowed actions only with the left
|
55 | mouse button by default
|
56 | ([54ebdc3](https://github.com/taye/interact.js/commit/54ebdc3e))
|
57 | - added repeating `hold` events
|
58 | ([fe11a8e](https://github.com/taye/interact.js/commit/fe11a8e5))
|
59 | - fixed `Interactable.off` ([PR
|
60 | #477](https://github.com/taye/interact.js/pull/477))
|
61 | - added `restrictEdges`, `restrictSize` and `snapSize` resize modifiers ([PR
|
62 | #455](https://github.com/taye/interact.js/pull/455))
|
63 |
|
64 | Full list of [changes on Github](https://github.com/taye/interact.js/compare/1.2.6...master).
|
65 |
|
66 | ## 1.2.6
|
67 |
|
68 | ### resize.preserveAspectRatio
|
69 |
|
70 | ```javascript
|
71 | interact(target).resizable({ preserveAspectRatio: true });
|
72 | ```
|
73 |
|
74 | See [PR #260](https://github.com/taye/interact.js/pull/260).
|
75 |
|
76 | ### Deprecated
|
77 | - `interact.margin(number)` - Use `interact(target).resizable({ margin: number });` instead
|
78 |
|
79 | ### Fixed
|
80 |
|
81 | - incorrect coordinates of the first movement of every action ([5e5a040](https://github.com/taye/interact.js/commit/5e5a040))
|
82 | - warning about deprecated "webkitForce" event property ([0943290](https://github.com/taye/interact.js/commit/0943290))
|
83 | - bugs with multiple concurrent interactions ([ed53aee](http://github.com/taye/interact.js/commit/ed53aee))
|
84 | - iPad 1, iOS 5.1.1 error "undefined is not a function" when autoScroll is set
|
85 | to true ([PR #194](https://github.com/taye/interact.js/pull/194))
|
86 |
|
87 | Full list of [changes on Github](https://github.com/taye/interact.js/compare/v1.2.5...master)
|
88 |
|
89 | ## 1.2.5
|
90 |
|
91 | ### Changed parameters to actionChecker and drop.checker
|
92 |
|
93 | - Added `event` as the first argument to actionCheckers. See commit [88dc583](https://github.com/taye/interact.js/commit/88dc583)
|
94 | - Added `dragEvent` as the first parameter to drop.checker functions. See
|
95 | commits [16d74d4](https://github.com/taye/interact.js/commit/16d74d4) and [d0c4b69](https://github.com/taye/interact.js/commit/d0c4b69)
|
96 |
|
97 | ### Deprecated methods
|
98 |
|
99 | interactable.accept - instead, use:
|
100 |
|
101 | ```javascript
|
102 | interact(target).dropzone({ accept: stringOrElement })
|
103 | ```
|
104 |
|
105 | interactable.dropChecker - instead, use:
|
106 |
|
107 | ```javascript
|
108 | interact(target).dropzone({ checker: function () {} })
|
109 | ```
|
110 |
|
111 | ### Added resize.margin
|
112 |
|
113 | See https://github.com/taye/interact.js/issues/166#issuecomment-91234390
|
114 |
|
115 | ### Fixes
|
116 |
|
117 | - touch coords on Presto Opera Mobile - see commits [886e54c](https://github.com/taye/interact.js/commit/886e54c) and [5a3a850](https://github.com/taye/interact.js/commit/5a3a850)
|
118 | - bug with multiple pointers - see commit [64882d3](https://github.com/taye/interact.js/commit/64882d3)
|
119 | - accessing certain recently deprecated event properties in Blink - see
|
120 | commits [e91fbc6](https://github.com/taye/interact.js/commit/e91fbc6) and [195cfe9](https://github.com/taye/interact.js/commit/195cfe9)
|
121 | - dropzones with `accept: 'pointer'` in scrolled pages on iOS6 and lower - see
|
122 | commit [0b94aac](https://github.com/taye/interact.js/commit/0b94aac)
|
123 | - setting styleCursor through Interactable options object - see [PR
|
124 | #270](https://github.com/taye/interact.js/pull/270)
|
125 | - one missed interaction element on stop triggered - see [PR
|
126 | #258](https://github.com/taye/interact.js/pull/258)
|
127 | - pointer dt on touchscreen devices - see [PR
|
128 | #215](https://github.com/taye/interact.js/pull/215)
|
129 | - autoScroll with containers with fixed position - see commit [3635840](https://github.com/taye/interact.js/commit/3635840)
|
130 | - autoScroll for mobile - see #180
|
131 | - preventDefault - see commits [1984c80](https://github.com/taye/interact.js/commit/1984c80) and [6913959](https://github.com/taye/interact.js/commit/6913959)
|
132 | - occasional error - see [issue
|
133 | #183](https://github.com/taye/interact.js/issue/183)
|
134 | - Interactable#unset - see [PR
|
135 | #178](https://github.com/taye/interact.js/pull/178)
|
136 | - coords of start event after manual start - see commit [fec73b2](https://github.com/taye/interact.js/commit/fec73b2)
|
137 | - bug with touch and selector interactables - see commit [d8df3de](https://github.com/taye/interact.js/commit/d8df3de)
|
138 | - touch doubletap bug - see [273f461](https://github.com/taye/interact.js/commit/273f461)
|
139 | - event x0/y0 with origin - see [PR
|
140 | #167](https://github.com/taye/interact.js/pull/167)
|
141 |
|
142 | ## 1.2.4
|
143 |
|
144 | ### Resizing from all edges
|
145 |
|
146 | With the new [resize edges API](https://github.com/taye/interact.js/pull/145),
|
147 | you can resize from the top and left edges of an element in addition to the
|
148 | bottom and right. It also allows you to specify CSS selectors, regions or
|
149 | elements as the resize handles.
|
150 |
|
151 | ### Better `dropChecker` arguments
|
152 |
|
153 | The arguments to `dropChecker` functions have been expanded to include the
|
154 | value of the default drop check and some other useful objects. See [PR
|
155 | 161](https://github.com/taye/interact.js/pull/161)
|
156 |
|
157 | ### Improved `preventDefault('auto')`
|
158 |
|
159 | If manuanStart is `true`, default prevention will happen only while
|
160 | interacting. Related to [Issue
|
161 | 138](https://github.com/taye/interact.js/issues/138).
|
162 |
|
163 | ### Fixed inaccurate snapping
|
164 |
|
165 | This removes a small inaccuracy when snapping with one or more
|
166 | `relativeOffsets`.
|
167 |
|
168 | ### Fixed bugs with multiple pointers
|
169 |
|
170 | ## 1.2.3
|
171 |
|
172 | ### ShadowDOM
|
173 |
|
174 | Basic support for ShadowDOM was implemented in [PR
|
175 | 143](https://github.com/taye/interact.js/pull/143)
|
176 |
|
177 | ### Fixed some issues with events
|
178 |
|
179 | Fixed Interactable#on({ type: listener }). b8a5e89
|
180 |
|
181 | Added a `double` property to tap events. `tap.double === true` if the tap will
|
182 | be followed by a `doubletap` event. See [issue
|
183 | 155](https://github.com/taye/interact.js/issues/155#issuecomment-71202352).
|
184 |
|
185 | Fixed [issue 150](https://github.com/taye/interact.js/issues/150).
|
186 |
|
187 | ## 1.2.2
|
188 |
|
189 | ### Fixed DOM event removal
|
190 |
|
191 | See [issue 149](https://github.com/taye/interact.js/issues/149).
|
192 |
|
193 | ## 1.2.1
|
194 |
|
195 | ### Fixed Gestures
|
196 |
|
197 | Gestures were completely [broken in
|
198 | v1.2.0](https://github.com/taye/interact.js/issues/146). They're fixed now.
|
199 |
|
200 | ### Restriction
|
201 |
|
202 | Fixed restriction to an element when the element doesn't have a rect (`display:
|
203 | none`, not in DOM, etc.). [Issue
|
204 | 144](https://github.com/taye/interact.js/issues/144).
|
205 |
|
206 | ## 1.2.0
|
207 |
|
208 | ### Multiple interactions
|
209 |
|
210 | Multiple interactions have been enabled by default. For example:
|
211 |
|
212 | ```javascript
|
213 | interact('.drag-element').draggable({
|
214 | enabled: true,
|
215 | // max : Infinity, // default
|
216 | // maxPerElement: 1, // default
|
217 | });
|
218 | ```
|
219 |
|
220 | will allow multiple `.drag-element` to be dragged simultaneously without having
|
221 | to explicitly set <code>max: integerGreaterThan1</code>. The default
|
222 | `maxPerElement` value is still 1 so only one drag would be able to happen on
|
223 | each `.drag-element` unless the `maxPerElement` is changed.
|
224 |
|
225 | If you don't want multiple interactions, call `interact.maxInteractions(1)`.
|
226 |
|
227 | ### Snapping
|
228 |
|
229 | #### Unified snap modes
|
230 | Snap modes have been
|
231 | [unified](https://github.com/taye/interact.js/pull/127). A `targets` array
|
232 | now holds all the snap objects and functions for snapping.
|
233 | `interact.createSnapGrid(gridObject)` returns a function that snaps to the
|
234 | dimensions of the given grid.
|
235 |
|
236 | #### `relativePoints` and `origin`
|
237 |
|
238 | ```javascript
|
239 | interact(target).draggable({
|
240 | snap: {
|
241 | targets: [ {x: 300, y: 300} ],
|
242 | relativePoints: [
|
243 | { x: 0, y: 0 }, // snap relative to the top left of the element
|
244 | { x: 1, y: 1 }, // and also to the bottom right
|
245 | ],
|
246 |
|
247 | // offset the snap target coordinates
|
248 | // can be an object with x/y or 'startCoords'
|
249 | offset: { x: 50, y: 50 }
|
250 | }
|
251 | });
|
252 | ```
|
253 |
|
254 | #### snap function interaction arg
|
255 |
|
256 | The current `Interaction` is now passed as the third parameter to snap functions.
|
257 |
|
258 | ```javascript
|
259 | interact(target).draggable({
|
260 | snap: {
|
261 | targets: [ function (x, y, interaction) {
|
262 | if (!interaction.dropTarget) {
|
263 | return { x: 0, y: 0 };
|
264 | }
|
265 | } ]
|
266 | });
|
267 | ```
|
268 |
|
269 | #### snap.relativePoints and offset
|
270 |
|
271 | The `snap.relativePoints` array succeeds the snap.elementOriign object. But
|
272 | backwards compatibility with `elementOrigin` and the old snapping interface is
|
273 | maintained.
|
274 |
|
275 | `snap.offset` lets you offset all snap target coords.
|
276 |
|
277 | See [this PR](https://github.com/taye/interact.js/pull/133) for more info.
|
278 |
|
279 | #### slight change to snap range calculation
|
280 |
|
281 | Snapping now occurs if the distance to the snap target is [less than or
|
282 | equal](https://github.com/taye/interact.js/commit/430c28c) to the target's
|
283 | range.
|
284 |
|
285 | ### Inertia
|
286 |
|
287 | `inertia.zeroResumeDelta` is now `true` by default.
|
288 |
|
289 | ### Per-action settings
|
290 |
|
291 | Snap, restrict, inertia, autoScroll can be different for drag, restrict and
|
292 | gesture. See [PR 115](https://github.com/taye/interact.js/pull/115).
|
293 |
|
294 | Methods for these settings on the `interact` object (`interact.snap()`,
|
295 | `interact.autoScroll()`, etc.) have been removed.
|
296 |
|
297 | ### Space-separated string and array event list and eventType:listener object
|
298 |
|
299 | ```javascript
|
300 | function logEventType (event) {
|
301 | console.log(event.type, event.target);
|
302 | }
|
303 |
|
304 | interact(target).on('down tap dragstart gestureend', logEventType);
|
305 |
|
306 | interact(target).on(['move', 'resizestart'], logEventType);
|
307 |
|
308 | interact(target).on({
|
309 | dragmove: logEvent,
|
310 | keydown : logEvent
|
311 | });
|
312 | ```
|
313 |
|
314 | ### Interactable actionChecker
|
315 |
|
316 | The expected return value from an action checker has changed from a string to
|
317 | an object. The object should have a `name` and can also have an `axis`
|
318 | property. For example, to resize horizontally:
|
319 |
|
320 | ```javascript
|
321 | interact(target).resizeable(true)
|
322 | .actionChecker(function (pointer, defaultAction, interactable, element) {
|
323 | return {
|
324 | name: 'resize',
|
325 | axis: 'x',
|
326 | };
|
327 | });
|
328 | ```
|
329 |
|
330 | ### Plain drop event objects
|
331 |
|
332 | All drop-related events are [now plain
|
333 | objects](https://github.com/taye/interact.js/issues/122). The related drag
|
334 | events are referenced in their `dragEvent` property.
|
335 |
|
336 | ### Interactable.preventDefault('always' || 'never' || 'auto')
|
337 |
|
338 | The method takes one of the above string values. It will still accept
|
339 | `true`/`false` parameters which are changed to `'always'`/`'never'`.
|
340 |
|
341 | ## 1.1.3
|
342 |
|
343 | ### Better Events
|
344 |
|
345 | Adding a function as a listener for an InteractEvent or pointerEvent type
|
346 | multiple times will cause that function to be fired multiple times for the
|
347 | event. Previously, adding the event type + function combination again had no
|
348 | effect.
|
349 |
|
350 | Added new event types [down, move, up, cancel,
|
351 | hold](https://github.com/taye/interact.js/pull/101).
|
352 |
|
353 | Tap and doubletap with multiple pointers was improved.
|
354 |
|
355 | Added a workaround for IE8's unusual [dblclick event
|
356 | sequence](http://www.quirksmode.org/dom/events/click.html) so that doubletap
|
357 | events are fired.
|
358 |
|
359 | Fixed a [tapping issue](https://github.com/taye/interact.js/issues/104) on
|
360 | Windows Phone/RT.
|
361 |
|
362 | Fixed a bug that caused the origins of all elements with tap listeners to be
|
363 | subtracted successively as a tap event propagated.
|
364 |
|
365 | [Fixed delegated events](https://github.com/taye/interact.js/commit/e972154)
|
366 | when different contexts have been used.
|
367 |
|
368 | ### iFrames
|
369 |
|
370 | [Added basic support](https://github.com/taye/interact.js/pull/98) for sharing
|
371 | one instance of interact.js between multiplie windows/frames. There are still
|
372 | some issues.
|