Ticket #1938 (closed bug: fixed)
Make getContentDivPadding() function safe
| Reported by: | euzuro | Owned by: | euzuro |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.8 Release |
| Component: | Popup | Version: | 2.7 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
Right now if you are in framedpopup world and you somehow* manage to call setSize() *after* the popup has been added to the map, the getContentDivPadding() function will not have the '_contentDivPadding' cached value loaded, and so it will try to calculate the padding by adding the popup's div directly to the document.body DOMElement (and then later removing it).
The problem is that if the popup's already been added to the map, then we are essentially yanking it from the containerDiv, adding it to the body, then removing it alltogether. End result: you never see your popup.
A simple test to see if the popup's div already has a parentNode is enough to spare us from this inconvenience.
* In the case of a framed popup with an overridden setContentHTML() function, it is possible. Unpleasant, unlikely, uncouth.... but possible.

