Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed wrong target for end drag event.

  • Loading branch information...
commit b57494f9f4b6f33fe7bd3cb055d77657866901ea 1 parent 1b4b8e7
@ngryman authored
Showing with 4 additions and 6 deletions.
  1. +1 −0  src/jquery.finger.js
  2. +3 −6 test/jquery.finger_test.js
View
1  src/jquery.finger.js
@@ -63,6 +63,7 @@
// for delegated events, the target may change over time
// this ensures we notify the right target and simulates the mouseleave behavior
if (event.target !== data.start.target) {
+ event.target = data.start.target;
stopHandler.call(this, $.Event(stopEvent + '.finger', event));
return;
}
View
9 test/jquery.finger_test.js
@@ -38,10 +38,8 @@
this.tapStart();
(function mv() {
- var now = Date.now(),
- dt = now - last;
-
- t += dt;
+ var now = Date.now();
+ t += now - last;
if (t >= duration) {
self.tapEnd();
callback.call(self);
@@ -112,7 +110,7 @@
describe('jquery.finger', function() {
beforeEach(function() {
- this.$elems = $('#fixtures .touchme');
+ this.$elems = $('#fixtures').find('.touchme');
});
afterEach(function() {
@@ -343,7 +341,6 @@
it('should correctly stop at the edge of an element for delegated events', function(done) {
var targets = [];
$('body').on('drag', '.touchme', function(event) {
- console.log(event.target);
if (-1 == targets.indexOf(event.target)) {
targets.push(event.target);
}
Please sign in to comment.
Something went wrong with that request. Please try again.