js fix for type toggle buttons