Created
April 12, 2011 15:28
-
-
Save tmcw/915716 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.clearTimeout = function() { | |
if (this.clickTimeout != null) { | |
window.clearTimeout(this.clickTimeout); | |
this.clickTimeout = null; | |
return true; | |
} else { | |
return false; | |
} | |
}; | |
$(this.parent).mousedown($.proxy(function(evt) { | |
if (this.clearTimeout()) { return; } | |
this.downEvent = evt; | |
$(this.parent).one('mouseup', $.proxy(function(evt) { | |
if (evt.pageY === this.downEvent.pageY && | |
evt.pageX === this.downEvent.pageX) { | |
this.clickTimeout = window.setTimeout( | |
function() { | |
alert('single click'); | |
// this.handleClick(evt) | |
}, 300); | |
} | |
}, this)); | |
}, this)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment