popup actually can use 'parentNode' to determine his parent. so no need to set anything. also, only try removing from viewPortDiv if popup.div is not null

git-svn-id: http://svn.openlayers.org/trunk/openlayers@231 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-21 17:54:23 +00:00
parent 21cbfff2c7
commit 8487728e09

View File

@@ -151,7 +151,6 @@ OpenLayers.Map.prototype = {
* @param {OpenLayers.Popup} popup
*/
addPopup: function(popup) {
popup.parent = this.viewPortDiv;
this.popups.push(popup);
var popupDiv = popup.draw();
if (popupDiv) {
@@ -166,9 +165,11 @@ OpenLayers.Map.prototype = {
*/
removePopup: function(popup) {
this.popups.remove(popup);
this.viewPortDiv.removeChild(popup.div);
if (popup.div) {
this.viewPortDiv.removeChild(popup.div);
}
},
/**
* @return {float}
*/