Add support in OL for right-click capturing, including dbl-right-clicks (for zooming out in navigation control). Thanks to David Martin for this nice patch and the great 8 foot austrian for his review (Closes #1359)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7872 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2008-08-26 23:27:04 +00:00
parent 091d3cfbeb
commit 17160f49e0
4 changed files with 132 additions and 11 deletions

View File

@@ -43,7 +43,7 @@
}
function test_Handler_Click_events(t) {
t.plan(35);
t.plan(50);
var map = new OpenLayers.Map('map');
var control = {
@@ -72,8 +72,8 @@
// list below events that should be handled (events) and those
// that should not be handled (nonevents) by the handler
var events = ["click", "dblclick", "mousedown"];
var nonevents = ["mousemove", "mouseup", "resize", "focus", "blur"];
var events = ["click", "dblclick", "mousedown", "mouseup", "rightclick"];
var nonevents = ["mousemove", "resize", "focus", "blur"];
var handler = new OpenLayers.Handler.Click(control);
// set browser event like properties on the handler
for(var i=0; i<events.length; ++i) {
@@ -82,7 +82,7 @@
handler.activate();
// different listeners registered for pixelTolerance option
var events = ["click", "dblclick", "mousedown", "mouseup"];
var events = ["click", "dblclick", "mousedown", "mouseup", "rightclick"];
var nonevents = ["mousemove", "resize", "focus", "blur"];
var handler = new OpenLayers.Handler.Click(control, {}, {
pixelTolerance: 2