This repository has been archived by the owner on Sep 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandr Gornostal
committed
May 29, 2012
1 parent
5d11e4f
commit 56bacbd
Showing
1 changed file
with
26 additions
and
20 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 |
---|---|---|
|
@@ -67,27 +67,33 @@ loadScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', functio | |
$.fn.checkin = function($wrp, color, should_rumble, callback){ | ||
var pressTimer, | ||
milkTimer, | ||
timeout = 1400; | ||
|
||
$(this).mousedown(function(e){ | ||
if (!$wrp.is(':visible')) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
syndicut
Collaborator
|
||
rumble(); | ||
addracker(e); | ||
pressTimer = setTimeout(function() { | ||
callback(); | ||
}, timeout); | ||
} | ||
return false; | ||
}); | ||
timeout = 1400, | ||
mouseDown = function(e){ | ||
if (!$wrp.is(':visible')) { | ||
rumble(); | ||
addracker(e); | ||
pressTimer = setTimeout(function() { | ||
callback(); | ||
}, timeout); | ||
} | ||
return false; | ||
}, | ||
mouseUp = function() { | ||
clearTimeout(pressTimer); | ||
delracker(); | ||
if(typeof soundManager !== 'undefined' && !$wrp.is(':visible')) | ||
{ | ||
soundManager.stopAll(); | ||
} | ||
}; | ||
|
||
$(document).mouseup(function() { | ||
clearTimeout(pressTimer); | ||
delracker(); | ||
if(typeof soundManager !== 'undefined' && !$wrp.is(':visible')) | ||
{ | ||
soundManager.stopAll(); | ||
} | ||
}); | ||
$(this).mousedown(mouseDown); | ||
$(document).mouseup(mouseUp); | ||
|
||
if (typeof document.addEventListener == 'function') { | ||
document.addEventListener('touchstart', mouseDown, false); | ||
document.addEventListener('touchend', mouseUp, false); | ||
} | ||
|
||
function draw(size ) { | ||
var milk = $('#kittychek-milk'); | ||
|
Думаю, здесь целесообразно делать e.preventDefault(), как думаешь?