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() {
|
draw: function() {
|
||||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||||
if (this.div.parentNode === this.map.viewPortDiv) {
|
if (this.outsideViewport) {
|
||||||
this.map.events.register("buttonclick", this, this.onButtonClick);
|
|
||||||
} else {
|
|
||||||
this.events.element = this.div;
|
this.events.element = this.div;
|
||||||
this.events.register("buttonclick", this, this.onButtonClick);
|
this.events.register("buttonclick", this, this.onButtonClick);
|
||||||
|
} else {
|
||||||
|
this.map.events.register("buttonclick", this, this.onButtonClick);
|
||||||
}
|
}
|
||||||
this.addControlsToMap(this.controls);
|
this.addControlsToMap(this.controls);
|
||||||
return this.div;
|
return this.div;
|
||||||
|
|||||||
Reference in New Issue
Block a user