title: When user touches and moves his finger, how to get which elements (vms) were touched with knockout.js
body: <p>I'm using knockout and I'm trying to achieve is this:</p>
  
  <p>I want the user to select some blocks:</p>
  
  <ol>
  <li>click the first block (it is selected)</li>
  <li>without releasing the mouse button, move the mouse around</li>
  <li>every block you pass through is selected</li>
  <li>release the button to stop selecting.</li>
  </ol>
  
  <p>It's very easy to do it using mouse events, but I need to target touch devices too (android, iphone, touch notebooks).</p>
  
  <p>How to have the same behavior using touch events with knockout?</p>
  
  <ol>
  <li>touch the first block</li>
  <li>without releasing the finger, move around</li>
  <li>select all touched blocks</li>
  <li>release the finger</li>
  </ol>
  
  <p>ps: I got stuck because when using touch events, the event source is locked to the first touched element (oh god, why???) and I can't figure out which others blocks the user touches.</p>
  
  <p>Here is a jsfiddle with my code:</p>
  
  <p><a href="https://jsfiddle.net/m38tfpq4/2/" rel="nofollow noreferrer">https://jsfiddle.net/m38tfpq4/2/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var vmBlock = function(label) {
    var self = this;
    self.text = label;
    self.color = ko.observable('grey');
  }
  
  var vm = function() {
    var self = this;
    self.isSelecting = false;
    self.blocks = [new vmBlock('a'), new vmBlock('b'), new vmBlock('c')];
    self.selectStart = function(block) {
      console.log('start');
      self.isSelecting = true;
      self.select(block);
    }
    self.selectEnd = function(block) {
      console.log('end');
      self.isSelecting = false;
    }
    self.select = function(block) {
      console.log('select: ' + self.isSelecting);
      if (!self.isSelecting) {
        return;
      }
      block.color('red');
    };
  };
  
  ko.applyBindings(new vm());</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.block {
    width: 100px;
    height: 100px;
    margin: 6px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"&gt;&lt;/script&gt;
  &lt;div class="container" data-bind="foreach: blocks"&gt;
    &lt;div class="block" onselectstart="return false" data-bind="text: text, style:{ 'background-color' : color }, event: { mousedown: $parent.selectStart, mouseover: $parent.select, mouseup: $parent.selectEnd }"&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>