diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/jqLite.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/jqLite.js b/src/jqLite.js index 67b6137d..d255845e 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -37,6 +37,7 @@ * - [clone()](http://api.jquery.com/clone/) * - [css()](http://api.jquery.com/css/) * - [data()](http://api.jquery.com/data/) + * - [eq()](http://api.jquery.com/eq/) * - [hasClass()](http://api.jquery.com/hasClass/) * - [parent()](http://api.jquery.com/parent/) * - [remove()](http://api.jquery.com/remove/) @@ -46,7 +47,7 @@ * - [replaceWith()](http://api.jquery.com/replaceWith/) * - [text()](http://api.jquery.com/text/) * - [trigger()](http://api.jquery.com/trigger/) - * - [eq()](http://api.jquery.com/eq/) + * - [unbind()](http://api.jquery.com/unbind/) * * ## In addtion to the above, Angular privides an additional method to both jQuery and jQuery lite: * @@ -401,6 +402,25 @@ forEach({ }); }, + unbind: function(element, type, fn) { + var bind = JQLiteData(element, 'bind'); + if (!bind) return; //no listeners registered + + if (isUndefined(type)) { + forEach(bind, function(eventHandler, type) { + removeEventListenerFn(element, type, eventHandler); + delete bind[type]; + }); + } else { + if (isUndefined(fn)) { + removeEventListenerFn(element, type, bind[type]); + delete bind[type]; + } else { + angularArray.remove(bind[type].fns, fn); + } + } + }, + replaceWith: function(element, replaceNode) { var index, parent = element.parentNode; JQLiteDealoc(element); |
