-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `longclick` method now accepts optional duration argument which overrides the default duration. * `jQuery.longclick.delay` has been renamed to `jQuery.longclick.duration`. * Invalid flag store key fixed. * Documentation comments & README updates.
- Loading branch information
Showing
4 changed files
with
57 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
Changelog | ||
========= | ||
|
||
0.2 | ||
--- | ||
* `longclick` method now accepts an optional duration argument which overrides the default duration. | ||
* `jQuery.longclick.delay` has been renamed to `jQuery.longclick.duration`. | ||
* Invalid flag store key fixed. | ||
* Documentation comments & README updates. | ||
|
||
0.1 | ||
--- | ||
* Initial release. |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
/* | ||
Longclick Event | ||
Copyright (c) 2010 Petr Vostrel (http://petr.vostrel.cz/) | ||
Dual licensed under the MIT (MIT-LICENSE.txt) | ||
and GPL (GPL-LICENSE.txt) licenses. | ||
Version: 0.1 | ||
Version: 0.2 | ||
Updated: 2010-05-31 | ||
*/ | ||
(function(a){function h(c){function i(){a(f).data(e,true);c.type=d;jQuery.event.handle.apply(f,j)}var f=this,j=arguments;a(this).data(e,false).data(g,setTimeout(i,a.longclick.delay))}function k(){clearTimeout(a(this).data(g))}function l(){if(a(this).data(e))return false}a.fn.longclick=function(c){return c?a(this).bind(d,c):a(this).trigger(d)};a.longclick={delay:500};a.event.special.longclick={setup:function(){a(this).bind(m,h).bind(n+" "+o,k).bind(p,l)},teardown:function(){a(this).unbind(b)}};var d= | ||
"longclick",b="."+d,m="mousedown"+b,p="click"+b,n="mousemove"+b,o="mouseup"+b,g="timer"+b,e="fired"+b})(jQuery); | ||
(function(a){function j(b){function d(){a(g).data(f,true);b.type=e;jQuery.event.handle.apply(g,k)}var g=this,k=arguments;a(this).data(f,false).data(h,setTimeout(d,a(this).data(i)||a.longclick.duration))}function l(){clearTimeout(a(this).data(h))}function m(){if(a(this).data(f))return false}a.fn.longclick=function(){var b=[].splice.call(arguments,0),d=b.pop();b=b.pop();b=a(this).data(i,b||null);return d?b.bind(e,d):b.trigger(e)};a.longclick={duration:500};a.event.special.longclick={setup:function(){a(this).bind(n, | ||
j).bind(o+" "+p,l).bind(q,m)},teardown:function(){a(this).unbind(c)}};var e="longclick",c="."+e,n="mousedown"+c,q="click"+c,o="mousemove"+c,p="mouseup"+c,i="duration"+c,h="timer"+c,f="fired"+c})(jQuery); |
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