Added method to indicate if the popup is open or closed.

Proposed solution to issue #2494.