Updated toggle class logic in JS search spinner