Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Test showing that all tests still pass when the skipDestroyOnNextJQueryCleanData flag is removed completely (it used to fail then) #8697

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
"createMap": false,
"VALIDITY_STATE_PROPERTY": false,

"skipDestroyOnNextJQueryCleanData": true,

/* filters.js */
"getFirstThursdayOfYear": false,

Expand Down
10 changes: 5 additions & 5 deletions src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ function snake_case(name, separator) {
}

var bindJQueryFired = false;
var skipDestroyOnNextJQueryCleanData;
//var skipDestroyOnNextJQueryCleanData;
function bindJQuery() {
var originalCleanData;

Expand Down Expand Up @@ -1468,13 +1468,13 @@ function bindJQuery() {
// the $destroy event on all removed nodes.
originalCleanData = jQuery.cleanData;
jQuery.cleanData = function(elems) {
if (!skipDestroyOnNextJQueryCleanData) {
// if (!skipDestroyOnNextJQueryCleanData) {
for (var i = 0, elem; (elem = elems[i]) != null; i++) {
jQuery(elem).triggerHandler('$destroy');
}
} else {
skipDestroyOnNextJQueryCleanData = false;
}
// } else {
// skipDestroyOnNextJQueryCleanData = false;
// }
originalCleanData(elems);
};
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// that would break if another library patches the method after Angular does (one
// example is jQuery UI). Instead, set a flag indicating scope destroying should be
// skipped this one time.
skipDestroyOnNextJQueryCleanData = true;
// skipDestroyOnNextJQueryCleanData = true;
jQuery.cleanData([firstElementToRemove]);
}

Expand Down