OpenLayers.Events.buttonclick

Extension event type for handling buttons on top of a dom element.  This event type fires “buttonclick” on its target when a button was clicked.  Buttons are detected by the “olButton” class.

This event type makes sure that button clicks do not interfere with other events that are registered on the same element.

Event types provided by this extension

  • buttonclick Triggered when a button is clicked.  Listeners receive an object with a buttonElement property referencing the dom element of the clicked button, and an buttonXY property with the click position relative to the button.
Summary
OpenLayers.Events.buttonclickExtension event type for handling buttons on top of a dom element.
Properties
target{OpenLayers.Events} The events instance that the buttonclick event will be triggered on.
events{Array} Events to observe and conditionally stop from propagating when an element with the olButton class (or its olAlphaImg child) is clicked.
startRegEx{RegExp} Regular expression to test Event.type for events that start a buttonclick sequence.
cancelRegEx{RegExp} Regular expression to test Event.type for events that cancel a buttonclick sequence.
completeRegEx{RegExp} Regular expression to test Event.type for events that complete a buttonclick sequence.
startEvt{Event} The event that started the click sequence
Constructor
OpenLayers.Events.buttonclickConstruct a buttonclick event type.
Functions
destroy
getPressedButtonGet the pressed button, if any.
buttonClickCheck if a button was clicked, and fire the buttonclick event

Properties

target

{OpenLayers.Events} The events instance that the buttonclick event will be triggered on.

events

{Array} Events to observe and conditionally stop from propagating when an element with the olButton class (or its olAlphaImg child) is clicked.

startRegEx

{RegExp} Regular expression to test Event.type for events that start a buttonclick sequence.

cancelRegEx

{RegExp} Regular expression to test Event.type for events that cancel a buttonclick sequence.

completeRegEx

{RegExp} Regular expression to test Event.type for events that complete a buttonclick sequence.

startEvt

{Event} The event that started the click sequence

Constructor

OpenLayers.Events.buttonclick

Construct a buttonclick event type.  Applications are not supposed to create instances of this class - they are created on demand by OpenLayers.Events instances.

Parameters

target{OpenLayers.Events} The events instance that the buttonclick event will be triggered on.

Functions

destroy

destroy: function()

getPressedButton

getPressedButton: function(element)

Get the pressed button, if any.  Returns undefined if no button was pressed.

Arguments

element{DOMElement} The event target.

Returns

{DOMElement} The button element, or undefined.

buttonClick

buttonClick: function(evt)

Check if a button was clicked, and fire the buttonclick event

Parameters

evt{Event}
destroy: function()
getPressedButton: function(element)
Get the pressed button, if any.
buttonClick: function(evt)
Check if a button was clicked, and fire the buttonclick event
{OpenLayers.Events} The events instance that the buttonclick event will be triggered on.
{DOMElement} the DOM element receiving browser events
Close