I currently write project using YUI(app framework). A have some actions for each elements( going to another page, clear etc.). I want to add long press action to each button. Unfortunately YUI doesn't support this kind of stuff. I found solution in jQuery:
var pressTimer
$("a").mouseup(function(){
clearTimeout(pressTimer)
// Clear timeout
return false;
}).mousedown(function(){
// Set timeout
pressTimer = window.setTimeout(function() { ... your code ...},1000)
return false;
});
And here is my question. How to add this feature to my current code? Writing new function doesn't work, so does adding this code to existing function.
//edited My code looks like this:
//stuff
events: {
'.button': {
click: 'select'
}
},
And then there is select function:
select: function (e) {
//code
}