diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index 0a6349dfef..80a95ff7ee 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -532,7 +532,9 @@ OpenLayers.Events = OpenLayers.Class({ */ register: function (type, obj, func) { - if (func != null) { + if (func != null && + ((this.eventTypes && OpenLayers.Util.indexOf(this.eventTypes, type) != -1) || + OpenLayers.Util.indexOf(this.BROWSER_EVENTS, type) != -1)) { if (obj == null) { obj = this.object; } diff --git a/tests/Extras.html b/tests/Extras.html new file mode 100644 index 0000000000..948f3abf99 --- /dev/null +++ b/tests/Extras.html @@ -0,0 +1,21 @@ + + + + + + +
+ + diff --git a/tests/list-tests.html b/tests/list-tests.html index 8ef9a61134..18823a8397 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -1,5 +1,6 @@