Fix table category collapse/expand javascript