Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

notifies the last drag event.

  • Loading branch information...
commit 08bd4b33683a8d8c55a64b862c315ac61f1dc61e 1 parent 0b0d5a4
Nicolas Gryman authored

Showing 2 changed files with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +1 0  src/jquery.finger.js
  2. +11 0 test/jquery.finger_test.js
1  src/jquery.finger.js
@@ -81,6 +81,7 @@
81 81 // motion events
82 82 else {
83 83 evtName = now - data.start.time < $.Finger.flickDuration ? 'flick' : 'drag';
  84 + data.move.end = true;
84 85 $.event.trigger($.Event(evtName + $.expando, data.move), null, event.target);
85 86 }
86 87
11 test/jquery.finger_test.js
@@ -304,6 +304,17 @@
304 304 this.drag(done, 50, 100);
305 305 });
306 306
  307 + it('should tell what the last event is', function(done) {
  308 + var end;
  309 + this.$elems.on('drag', function(e) {
  310 + end = e.end;
  311 + });
  312 + this.drag(function() {
  313 + end.should.be.truthy;
  314 + done();
  315 + }, 100, 0);
  316 + });
  317 +
307 318 it('should not fire removed events', function(done) {
308 319 var self = this;
309 320 var handler = sinon.spy();

0 comments on commit 08bd4b3

Please sign in to comment.
Something went wrong with that request. Please try again.