make the PREVENT_CLOSE_CLASS more lax

look at target and its ancestors when checking for the PREVENT_CLOSE_CLASS