Adds field expand/collapse functionality