Fix an issue that touch doesn't work
Refactor code for click event