From 0cd7e8f22721f62b62440bb059ae764ebbe7b42a Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 18 Nov 2013 22:13:28 -0500 Subject: fix($compile): ensure CSS classes are added and removed only when necessary When $compile interpolates a CSS class attribute expression it will do so by comparing the CSS class value already present on the element. This may lead to unexpected results when dealing with ngClass values being added and removed therefore it is best that both compile and ngClass delegate addClass/removeClass operations to the same block of code. --- src/Angular.js | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index b27f4b06..11222118 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -81,7 +81,6 @@ -assertNotHasOwnProperty, -getter, -getBlockElements, - -tokenDifference */ @@ -1351,24 +1350,3 @@ function getBlockElements(block) { return jqLite(elements); } - -/** - * Return the string difference between tokens of the original string compared to the old string - * @param {str1} string original string value - * @param {str2} string new string value - */ -function tokenDifference(str1, str2) { - var values = '', - tokens1 = str1.split(/\s+/), - tokens2 = str2.split(/\s+/); - - outer: - for(var i=0;i 0 ? ' ' : '') + token; - } - return values; -} -- cgit v1.2.3