Check return values from activate()/deactivate() in subclassed Handlers and Controls, as appropriate. Fixes #599.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2955 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -34,20 +34,28 @@ OpenLayers.Control.Panel.prototype =
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
OpenLayers.Control.prototype.activate.apply(this, arguments);
|
||||
for(var i = 0; i < this.controls.length; i++) {
|
||||
if (this.controls[i] == this.defaultControl) {
|
||||
this.controls[i].activate();
|
||||
}
|
||||
}
|
||||
this.redraw();
|
||||
if (OpenLayers.Control.prototype.activate.apply(this, arguments)) {
|
||||
for(var i = 0; i < this.controls.length; i++) {
|
||||
if (this.controls[i] == this.defaultControl) {
|
||||
this.controls[i].activate();
|
||||
}
|
||||
}
|
||||
this.redraw();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
deactivate: function() {
|
||||
OpenLayers.Control.prototype.deactivate.apply(this, arguments);
|
||||
for(var i = 0; i < this.controls.length; i++) {
|
||||
this.controls[i].deactivate();
|
||||
}
|
||||
this.redraw();
|
||||
if (OpenLayers.Control.prototype.deactivate.apply(this, arguments)) {
|
||||
for(var i = 0; i < this.controls.length; i++) {
|
||||
this.controls[i].deactivate();
|
||||
}
|
||||
this.redraw();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user