diff --git a/reference.html b/reference.html index 437b97fe..c3e1bda4 100644 --- a/reference.html +++ b/reference.html @@ -5207,18 +5207,18 @@ Popups will also be automatically opened when the layer is clicked on and closed this - Adds a listener fn to the element's DOM events. types is a space-separated list of DOM event types to listen to. this keyword inside the listener will point to context, or to the element if not specified. + + Adds a listener function (fn) to a particular DOM event type of the element el. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick'). - addListener( + on( <HTMLElement> el, - <String> types, - <Function> fn, + <Object> eventMap, <Object> context? ) this - Alias for DomEvent.on. + Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} off( @@ -5229,7 +5229,28 @@ Popups will also be automatically opened when the layer is clicked on and closed this - Removes the event listener fn from the element, for the DOM event types in types (a space-separated list). Both fn and context must be equal to the function and context used previously on a L.DomEvent.on call. + + Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular DOM event from the element. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener. + + + off( + <HTMLElement> el, + <Object> eventMap, + <Object> context? ) + + + this + Removes a set of type/listener pairs. + + addListener( + <HTMLElement> el, + <String> types, + <Function> fn, + <Object> context? ) + + + this + Alias to on. removeListener( @@ -5240,7 +5261,7 @@ Popups will also be automatically opened when the layer is clicked on and closed this - Alias for DomEvent.off. + Alias to off. stopPropagation(