From 815053e403ace666b2383643227ecde5f36742c5 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski Date: Tue, 30 Apr 2013 11:29:07 +0200 Subject: fix(jqLite): correctly monkey-patch core jQuery methods When real jQuery is present, Angular monkey patch it to fire `$destroy` event. This commit fixes two issues in the jQuery patch: - passing a selector to the $.fn.remove method (only fire `$destroy` on the matched elements) - using `$.fn.html` without parameters as a getter (do not fire `$destroy`) --- src/Angular.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index da1bf226..1c1a0255 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1016,9 +1016,10 @@ function bindJQuery() { injector: JQLitePrototype.injector, inheritedData: JQLitePrototype.inheritedData }); - JQLitePatchJQueryRemove('remove', true); - JQLitePatchJQueryRemove('empty'); - JQLitePatchJQueryRemove('html'); + // Method signature: JQLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) + JQLitePatchJQueryRemove('remove', true, true, false); + JQLitePatchJQueryRemove('empty', false, false, false); + JQLitePatchJQueryRemove('html', false, false, true); } else { jqLite = JQLite; } -- cgit v1.2.3