Term: compersion
Example: jack has developed a keen sense of compersion to maintain his sanity after his girlfriend jill, went to [shag] her other boyfriend john
Definition: "the act of living vicariously though one of your own girl/boyfriends because they chose to abandon you and spend quality-time with someone else