Check for outsideViewport - we may not have a parentNode yet.
This commit is contained in:
@@ -169,11 +169,11 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
if (this.div.parentNode === this.map.viewPortDiv) {
|
||||
this.map.events.register("buttonclick", this, this.onButtonClick);
|
||||
} else {
|
||||
if (this.outsideViewport) {
|
||||
this.events.element = this.div;
|
||||
this.events.register("buttonclick", this, this.onButtonClick);
|
||||
} else {
|
||||
this.map.events.register("buttonclick", this, this.onButtonClick);
|
||||
}
|
||||
this.addControlsToMap(this.controls);
|
||||
return this.div;
|
||||
|
||||
Reference in New Issue
Block a user