Fixed double click

Code was adding both a touchstart and click event listener which
resulted in two clicks on touch devices. Code now first checks
navigator.userAgent for ‘mobile’ and then decides what eventListener to
add.