Changeset - e8229d389948
[Not reviewed]
default
0 2 0
Mads Kiilerich - 10 years ago 2016-01-05 16:55:52
madski@unity3d.com
js: move .diff-collapse-button handling from the global base.js to the special diff js

Move it where it belongs and avoid adding more stuff to the global js later.
2 files changed with 13 insertions and 17 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -1912,20 +1912,3 @@ var prefixFirstSort = function(results, 
 
    }
 
    return results;
 
};
 

	
 
// global hooks after DOM is loaded
 

	
 
$(document).ready(function(){
 
    $('.diff-collapse-button').click(function(e) {
 
        var $button = $(e.currentTarget);
 
        var $target = $('#' + $button.attr('target'));
 
        if($target.hasClass('hidden')){
 
            $target.removeClass('hidden');
 
            $button.html("↑ {0} ↑".format(_TM['Collapse Diff']));
 
        }
 
        else if(!$target.hasClass('hidden')){
 
            $target.addClass('hidden');
 
            $button.html("↓ {0} ↓".format(_TM['Expand Diff']));
 
        }
 
    });
 
});
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -151,6 +151,19 @@ $(document).ready(function(){
 
    };
 
    $('.btn-image-diff-swap').mouseup(reset);
 
    $('.btn-image-diff-swap').mouseleave(reset);
 

	
 
    $('.diff-collapse-button').click(function(e) {
 
        var $button = $(e.currentTarget);
 
        var $target = $('#' + $button.attr('target'));
 
        if($target.hasClass('hidden')){
 
            $target.removeClass('hidden');
 
            $button.html("↑ {0} ↑".format(_TM['Collapse Diff']));
 
        }
 
        else if(!$target.hasClass('hidden')){
 
            $target.addClass('hidden');
 
            $button.html("↓ {0} ↓".format(_TM['Expand Diff']));
 
        }
 
    });
 
});
 
</script>
 
</%def>
0 comments (0 inline, 0 general)