Let's not over-engineer things (see #164).
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user