hammerjs/simulator — pull request #2 by bumbu (2014-09-15 17:08:24+00:00)
Title: Add support for multitouches with few target elements

### The problem
Right now it is possible to simulate only multitouch events that have as a target one single element.
This pull request adds possibility to simulate multitouch events that have multiple targets.
Related to hammerjs/hammer.js#600 (will allow creating tests that that issue).

### Changes
API did not change. [Hammer.js](https://github.com/hammerjs/hammer.js) tests are passing 100%.

In order to simulate a multitouch event (ex. pinch) that has multiple targets it is enough to pass an array of elements instead of one element.

```js
var el = document.getElementById('element');
var cel = document.getElementById('child-element');

Simulator.gestures.pinch([el, cel], { duration: 50, scale: .5 }, function(){})
```
where DOM structure may look like:
```html

````

If only one element is specified `Simulator.gestures.pinch([el])` then it will be applied to both events as target.

If more elements are specified `Simulator.gestures.pinch([el, el1, el2, el3])` only first X will be used where X is the number of touches.

### Side effects
It may be observed that number of triggered events is multiplied by number of touches (right now at max 2 touches are simulated). It is done in order to simulate moving of each touch separately. Also when touchend happens it is first performed for one finger and then for the other.