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:
@@ -42,18 +42,26 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
OpenLayers.Handler.prototype.activate.apply(this, arguments);
|
||||
for (var i = 0; i < this.KEY_EVENTS.length; i++) {
|
||||
OpenLayers.Event.observe(
|
||||
window, this.KEY_EVENTS[i], this.eventListener);
|
||||
if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
|
||||
for (var i = 0; i < this.KEY_EVENTS.length; i++) {
|
||||
OpenLayers.Event.observe(
|
||||
window, this.KEY_EVENTS[i], this.eventListener);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
deactivate: function() {
|
||||
OpenLayers.Handler.prototype.activate.apply(this, arguments);
|
||||
for (var i = 0; i < this.KEY_EVENTS.length; i++) {
|
||||
OpenLayers.Event.stopObserving(
|
||||
document, this.KEY_EVENTS[i], this.eventListener);
|
||||
if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
|
||||
for (var i = 0; i < this.KEY_EVENTS.length; i++) {
|
||||
OpenLayers.Event.stopObserving(
|
||||
document, this.KEY_EVENTS[i], this.eventListener);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user