Ticket #1938 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

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.

Attachments

safeDivPadding.patch Download (1.5 KB) - added by euzuro 4 years ago.

Change History

Changed 4 years ago by euzuro

Changed 4 years ago by euzuro

all tests pass ff3, ie7

Changed 4 years ago by crschmidt

  • state set to Review
  • milestone set to 2.8 Release

Changed 4 years ago by crschmidt

  • state changed from Review to Commit

I don't see any major issues with this. Please commit.

Changed 4 years ago by euzuro

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [8980]) Make the derivation of the '_contentDivPadding' value safe in the case where the popup is already added to the map's containerDiv. (Closes #1938)

Note: See TracTickets for help on using tickets.