Changing default functionality for legends to toggle