Panel: Fix link listener on removed panel

This change removes panels from receiving the link listener click event by making sure that the panel exists in the DOM before attempting to toggle its state.

Fixes Issue #6309 - Panel: Link listener fires on removed panel