Panel: use self._off for panelclose instead of document.off

Fixes gh-7058
Closes gh-7260