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

Commit 4b4bbfb

Browse files
committed
Removed two functions.
1 parent 03d9c8d commit 4b4bbfb

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

src/ng/directive/ngId.js

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,41 @@ function idDirective(name, selector) {
3535

3636
// New
3737
function uniqueId(id) {
38-
/* Check if the id is unique throughout the view */
38+
/* Check if the id is unique throughout the view
39+
* Should search $index for the ID.
40+
*/
3941
}
4042

4143
// This is the joining function. This shouldn't exist
42-
function digestIdCounts (ids, count) {
43-
var idCounts = element.data('$idCounts') || {};
44-
var idsToUpdate = [];
45-
forEach(ids, function (idName) {
46-
if (count > 0 || idCounts[idName]) {
47-
idCounts[idName] = (idCounts[idName] || 0) + count;
48-
if (idCounts[idName] === +(count > 0)) {
49-
idsToUpdate.push(idName);
50-
}
51-
}
52-
});
53-
element.data('$idCounts', idCounts);
54-
return idsToUpdate.join(' ');
55-
}
56-
57-
function updateClasses (oldClasses, newClasses) {
58-
var toAdd = arrayDifference(newClasses, oldClasses);
59-
var toRemove = arrayDifference(oldClasses, newClasses);
60-
toRemove = digestClassCounts(toRemove, -1);
61-
toAdd = digestClassCounts(toAdd, 1);
62-
63-
if (toAdd.length === 0) {
64-
$animate.removeClass(element, toRemove);
65-
} else if (toRemove.length === 0) {
66-
$animate.addClass(element, toAdd);
67-
} else {
68-
$animate.setClass(element, toAdd, toRemove);
69-
}
70-
}
44+
// function digestIdCounts (ids, count) {
45+
// var idCounts = element.data('$idCounts') || {};
46+
// var idsToUpdate = [];
47+
// forEach(ids, function (idName) {
48+
// if (count > 0 || idCounts[idName]) {
49+
// idCounts[idName] = (idCounts[idName] || 0) + count;
50+
// if (idCounts[idName] === +(count > 0)) {
51+
// idsToUpdate.push(idName);
52+
// }
53+
// }
54+
// });
55+
// element.data('$idCounts', idCounts);
56+
// return idsToUpdate.join(' ');
57+
// }
58+
59+
//function updateClasses (oldClasses, newClasses) {
60+
// var toAdd = arrayDifference(newClasses, oldClasses);
61+
// var toRemove = arrayDifference(oldClasses, newClasses);
62+
// toRemove = digestClassCounts(toRemove, -1);
63+
// toAdd = digestClassCounts(toAdd, 1);
64+
65+
// if (toAdd.length === 0) {
66+
// $animate.removeClass(element, toRemove);
67+
// } else if (toRemove.length === 0) {
68+
// $animate.addClass(element, toAdd);
69+
// } else {
70+
// $animate.setClass(element, toAdd, toRemove);
71+
// }
72+
// }
7173

7274
function ngIdWatchAction(newVal) {
7375
if (selector === true || scope.$index % 2 === selector) {

0 commit comments

Comments
 (0)