dom-delegate
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -104,3 +104,3 @@ /*jshint browser:true, node:true*/ | ||
Delegate.prototype.captureForType = function(eventType) { | ||
return ['error', 'blur', 'focus', 'scroll', 'resize'].indexOf(eventType) !== -1; | ||
return ['blur', 'error', 'focus', 'load', 'resize', 'scroll'].indexOf(eventType) !== -1; | ||
}; | ||
@@ -327,3 +327,3 @@ | ||
// TODO:MCG:20120117: Need a way | ||
// to check if event#stopImmediateProgagation | ||
// to check if event#stopImmediatePropagation | ||
// was called. If so, break both loops. | ||
@@ -345,3 +345,3 @@ if (listener.matcher.call(target, listener.matcherParam, target)) { | ||
// TODO:MCG:20120117: Need a way to | ||
// check if event#stopProgagation | ||
// check if event#stopPropagation | ||
// was called. If so, break looping | ||
@@ -348,0 +348,0 @@ // through the DOM. Stop if the |
{ | ||
"name": "dom-delegate", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "FT Labs <enquiries@labs.ft.com> (http://labs.ft.com/)", | ||
@@ -5,0 +5,0 @@ "description": "Create and manage a DOM event delegator.", |
@@ -5,3 +5,3 @@ # ftdomdelegate [![Build Status](https://travis-ci.org/ftlabs/ftdomdelegate.svg?branch=master)](https://travis-ci.org/ftlabs/ftdomdelegate) | ||
Delegate is developed by [FT Labs](http://labs.ft.com/), part of the Financial Times. | ||
FT DOM Delegate is developed by [FT Labs](http://labs.ft.com/), part of the Financial Times. | ||
@@ -28,2 +28,4 @@ ## Compatibility ## | ||
Get the [browserify](http://browserify.org/)-able source from a package manager: | ||
``` | ||
@@ -41,6 +43,27 @@ npm install dom-delegate | ||
Download the [built version](http://wzrd.in/standalone/dom-delegate@latest). | ||
Download the [built version](http://wzrd.in/standalone/dom-delegate@latest). (Note: this exposes the API via `window.domDelegate.Delegate`) | ||
## Usage ## | ||
The library is written in CommonJS and so can either be `require` in or the prebuilt wzrd.in version can be used, which makes the API available via `window.domDelegate.Delegate`. | ||
```js | ||
var delegate, Delegate, myDel; | ||
// If using the wzrd.in pre-built javascript, either:- | ||
Delegate = domDelegate.Delegate | ||
myDel = new Delegate(document.body); | ||
// Or:- | ||
myDel = domDelegate(document.body); | ||
// If requiring the module via CommonJS, either:- | ||
Delegate = require('dom-delegate').Delegate; | ||
myDel = new Delegate(document.body); | ||
// Or:- | ||
delegate = require('dom-delegate'); | ||
myDel = delegate(document.body); | ||
``` | ||
The script must be loaded prior to instantiating a Delegate object. | ||
@@ -124,3 +147,3 @@ | ||
#### `selector (string|function)` #### | ||
#### `selector (string)` #### | ||
@@ -131,3 +154,3 @@ Any kind of valid CSS selector supported by [`matchesSelector`](http://caniuse.com/matchesselector). Some selectors, like `#id` or `tag` will use optimized functions internally that check for straight matches between the ID or tag name of elements. | ||
#### `handler (function|boolean)` #### | ||
#### `handler (function)` #### | ||
@@ -148,3 +171,3 @@ Function that will handle the specified event on elements matching the given selector. The function will receive two arguments: the native event object and the target element, in that order. | ||
#### `selector (string|function)` #### | ||
#### `selector (string)` #### | ||
@@ -155,3 +178,3 @@ Only remove listeners registered with the given selector, among the other arguments. | ||
#### `handler (function|boolean)` #### | ||
#### `handler (function)` #### | ||
@@ -158,0 +181,0 @@ Only remove listeners registered with the given handler function, among the other arguments. If not provided, remove all handlers. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39432
193