Changeset - 720339c9f81c
[Not reviewed]
stable
0 1 0
Jan Heylen (heyleke) - 9 years ago 2015-12-24 20:28:19
heyleke@gmail.com
diff: get collapse target via .attr instead of .prop

Commit 3f017db297c4 was not fully tested and broke collapse/expand of diffs on
changesets. $button is not a link with a target and the target can thus not be
retrieved with .prop('target'); $button is just a span that happens to have a
custom attribute with the name 'target'.

We thus revert back to the old way of retrieving it with .attr('target'). (It
would perhaps be even better to use data attributes and name it data-target and
use .data('target') ...)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general) First comment
kallithea/public/js/base.js
Show inline comments
 
@@ -1886,7 +1886,7 @@ var branchSort = function(results, conta
 
$(document).ready(function(){
 
    $('.diff-collapse-button').click(function(e) {
 
        var $button = $(e.currentTarget);
 
        var $target = $('#' + $button.prop('target'));
 
        var $target = $('#' + $button.attr('target'));
 
        if($target.hasClass('hidden')){
 
            $target.removeClass('hidden');
 
            $button.html("↑ {0} ↑".format(_TM['Collapse Diff']));
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now