fix Issue #417, indexOf return fail during the first click.

I am new to CoffeeScript.

I think that the behavior of a 'binding' strange, because this function is called 2 times during the click.