[PATCH 2 of 7 v3] pullrequest: expand diff on file link click

Jan Heylen heyleke at gmail.com
Sat Jan 2 12:15:02 UTC 2016


# HG changeset patch
# User Jan Heylen <heyleke at gmail.com>
# Date 1451732169 -3600
#      Sat Jan 02 11:56:09 2016 +0100
# Node ID 460232c9255e08d54e6f61bd0ed9e1fa60b7d3e2
# Parent  e2a12ba47a16d4258b2c5c946f38f32c9e6c367e
pullrequest: expand diff on file link click

diff -r e2a12ba47a16 -r 460232c9255e kallithea/public/js/base.js
--- a/kallithea/public/js/base.js	Sat Jan 02 11:55:36 2016 +0100
+++ b/kallithea/public/js/base.js	Sat Jan 02 11:56:09 2016 +0100
@@ -1928,4 +1928,10 @@
             $button.html("↓ {0} ↓".format(_TM['Expand Diff']));
         }
     });
+    $('.expand-diffs').click(function(e){
+         var $button = $('.diff-collapse-button');
+         var $target = $('#' + $button.attr('target'));
+         $target.removeClass('hidden');
+         $button.html("↑ {0} ↑".format(_TM['Collapse Diff']));
+    });
 });
diff -r e2a12ba47a16 -r 460232c9255e kallithea/templates/pullrequests/pullrequest_show.html
--- a/kallithea/templates/pullrequests/pullrequest_show.html	Sat Jan 02 11:55:36 2016 +0100
+++ b/kallithea/templates/pullrequests/pullrequest_show.html	Sat Jan 02 11:56:09 2016 +0100
@@ -329,7 +329,7 @@
                     <div class="cs_${change}">
                       <div class="node">
                           <i class="icon-diff-${change}"></i>
-                          ${h.link_to(h.safe_unicode(f),'#' + fid)}
+                          ${h.link_to(h.safe_unicode(f),'#' + fid, class_="expand-diffs")}
                       </div>
                       <div class="changes">${h.fancy_file_stats(stat)}</div>
                     </div>


More information about the kallithea-general mailing list