+2011-01-12 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ show shared lines on both sides in code review tool
+ https://bugs.webkit.org/show_bug.cgi?id=52308
+
+ We were appending the same DOM node twice. Instead, make
+ the from column a clone of the original node.
+
+ * code-review.js:
+
2011-01-12 Ojan Vafai <ojan@chromium.org>
Reviewed by Adam Barth.
var to_class = '';
var from_attributes = '';
var to_attributes = '';
- var from_contents = contents;
+ // Clone the contents so we have two copies we can put back in the DOM.
+ var from_contents = contents.clone(true);
var to_contents = contents;
+ var container_class = 'LineContainer';
+ var container_attributes = '';
+
if (from && !to) { // This is a remove line.
from_class = classNames;
from_attributes = attributes;
to_class = classNames;
to_attributes = attributes;
from_contents = '';
- }
-
- var container_class = 'LineContainer';
- var container_attributes = '';
- if (!to_attributes && !from_attributes) {
+ } else {
container_attributes = attributes;
container_class += ' Line ' + classNames;
}