Let's not over-engineer things (see #164).

This commit is contained in:
ahocevar
2012-01-21 10:46:44 +01:00
parent c38f4ce7bb
commit 9f9feabfae
2 changed files with 5 additions and 16 deletions

View File

@@ -64,20 +64,11 @@ OpenLayers.Events.buttonclick = OpenLayers.Class({
* <OpenLayers.Events> instances.
*
* Parameters:
* options - {<OpenLayers.Events>|Object} Target instance of
* <OpenLayers.Events> or configuration properties for this
* <OpenLayers.Events.buttonclick> instance.
*
* Required configuration properties:
* target - {<OpenLayers.Events>} The events instance that the buttonclick
* event will be triggered on.
*/
initialize: function(options) {
if (options instanceof OpenLayers.Events) {
options = {target: options};
}
OpenLayers.Util.extend(this, options);
initialize: function(target) {
this.target = target;
for (var i=this.events.length-1; i>=0; --i) {
this.target.register(this.events[i], this, this.buttonClick, {
extension: true
@@ -118,12 +109,12 @@ OpenLayers.Events.buttonclick = OpenLayers.Class({
if (this.cancelRegEx.test(evt.type)) {
delete this._buttonStarted;
}
OpenLayers.Event.stop(evt, false);
OpenLayers.Event.stop(evt);
propagate = false;
}
if (this.startRegEx.test(evt.type)) {
this._buttonStarted = true;
OpenLayers.Event.stop(evt, false);
OpenLayers.Event.stop(evt);
propagate = false;
}
} else {