2011-02-25 Ojan Vafai <ojan@chromium.org>
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Feb 2011 03:39:20 +0000 (03:39 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Feb 2011 03:39:20 +0000 (03:39 +0000)
        Reviewed by Adam Barth.

        [codereviewtool] fix expand links on git diffs
        https://bugs.webkit.org/show_bug.cgi?id=55208

        In git diffs, we don't have a "revision" span at the end
        of each FileDiff.
        * code-review.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79836 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/bugs.webkit.org/ChangeLog
Websites/bugs.webkit.org/code-review.js

index 3e526ac..a3ad327 100644 (file)
@@ -1,3 +1,14 @@
+2011-02-25  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [codereviewtool] fix expand links on git diffs
+        https://bugs.webkit.org/show_bug.cgi?id=55208
+
+        In git diffs, we don't have a "revision" span at the end
+        of each FileDiff.
+        * code-review.js:
+
 2011-02-23  Ojan Vafai  <ojan@chromium.org>
 
         Reviewed by Tony Chang.
index f8d673c..00fb5d2 100644 (file)
@@ -646,11 +646,12 @@ var CODE_REVIEW_UNITTEST;
 
     $('br', file_diff).replaceWith(expandBarHtml());
 
+    // jquery doesn't support :last-of-type, so use querySelector instead.
     var last_line = file_diff.querySelector('.LineContainer:last-of-type');
     // Some patches for new files somehow end up with an empty context line at the end
     // with a from line number of 0. Don't show expand links in that case either.
     if (!$(last_line).hasClass('add') && !$(last_line).hasClass('remove') && fromLineNumber(last_line) != 0)
-      $('.revision', file_diff).before(expandBarHtml(ABOVE));
+      $(file_diff.querySelector('.DiffSection:last-of-type')).after(expandBarHtml(ABOVE));
   }
 
   function expandBarHtml(opt_direction) {