Skip to content

Commit

Permalink
Encapsulate difference IDs, return them as array.
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Thang committed Sep 18, 2015
1 parent 4046a94 commit f6488ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion diffview.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ diffview = {

var lastChange = "equal";
var differences = 0;
var diffIds = [];

for (var idx = 0; idx < opcodes.length; idx++) {
code = opcodes[idx];
Expand Down Expand Up @@ -187,6 +188,7 @@ diffview = {
if (change != "equal") {
differences++;
node.setAttribute("id", "diffview_difference_" + differences);
diffIds.push("diffview_difference_" + differences);
}
}
}
Expand All @@ -203,7 +205,8 @@ diffview = {

return {
diffOutput: node,
differences: differences
differences: differences,
diffIds: diffIds,
}
}
};

0 comments on commit f6488ef

Please sign in to comment.