Pan tool JS