Fix js error on non-touch devices