fix remove() function and add test

git-svn-id: http://svn.openlayers.org/trunk/openlayers@871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-04 13:13:41 +00:00
parent abac8a5d44
commit 585ec9e192
2 changed files with 35 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ OpenLayers.Events.prototype = {
/**
* @param {String} type
* @param {Object} obj
* @param {Object} obj If none specified, defaults to this.object
* @param {Function} func
*/
unregister: function (type, obj, func) {
@@ -127,11 +127,15 @@ OpenLayers.Events.prototype = {
}
},
/**
/** Remove all listeners for a given event type. If type is not registered,
* does nothing.
*
* @param {String} type
*/
remove: function(type) {
this.listeners[type].pop();
if (this.listeners[type] != null) {
this.listeners[type] = new Array();
}
},
/** Trigger a specified registered event