Skip to content
Browse files

notifies the last drag event.

  • Loading branch information...
1 parent 0b0d5a4 commit 08bd4b33683a8d8c55a64b862c315ac61f1dc61e @ngryman committed Mar 3, 2013
Showing with 12 additions and 0 deletions.
  1. +1 −0 src/jquery.finger.js
  2. +11 −0 test/jquery.finger_test.js
View
1 src/jquery.finger.js
@@ -81,6 +81,7 @@
// motion events
else {
evtName = now - data.start.time < $.Finger.flickDuration ? 'flick' : 'drag';
+ data.move.end = true;
$.event.trigger($.Event(evtName + $.expando, data.move), null, event.target);
}
View
11 test/jquery.finger_test.js
@@ -304,6 +304,17 @@
this.drag(done, 50, 100);
});
+ it('should tell what the last event is', function(done) {
+ var end;
+ this.$elems.on('drag', function(e) {
+ end = e.end;
+ });
+ this.drag(function() {
+ end.should.be.truthy;
+ done();
+ }, 100, 0);
+ });
+
it('should not fire removed events', function(done) {
var self = this;
var handler = sinon.spy();

0 comments on commit 08bd4b3

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