I want to be able to bind a single and double click event to a span of text. I know I can use
data-bind ="event: { dblclick: doSomething }
for a double click, but I also need the ability to perform a different function on single click. Any suggestions?
First, I wouldn’t recommend
clickbinding at all. Instead you should use"click"and"dblclick"handlers from jQuery:Edit: see also Niko’s suggestion regarding supporting both single and double clicks. Basically, you should count the number of clicks manually and call different functions accordingly. I assumed jQuery handles this for you but, unfortunately, it doesn’t.