Changeset - 7db8e58cee2f
[Not reviewed]
default
0 2 0
Jan Heylen - 10 years ago 2015-11-29 16:43:42
heyleke@gmail.com
diffs: introduce 'show inline comments' control for pull-requests too

Make diff_block_simple control inline comments like diff_block does.

.show-inline-comments handling is moved to the generic diff handling js.

I am not sure this is useful when the whole diff is sent to the client side
anyway ... but for now, let's be consistent.
2 files changed with 18 insertions and 13 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -209,19 +209,6 @@ ${self.repo_context_bar('changelog', c.c
 
    ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
 
    <script type="text/javascript">
 
      $(document).ready(function(){
 
          $('.show-inline-comments').change(function(e){
 
              var target = e.currentTarget;
 
              if(target == null){
 
                  target = this;
 
              }
 
              var boxid = $(target).attr('id_for');
 
              if(target.checked){
 
                  $('#{0} .inline-comments'.format(boxid)).show();
 
              }else{
 
                  $('#{0} .inline-comments'.format(boxid)).hide();
 
              }
 
          });
 

	
 
          $('.code-difftable').on('click', '.add-bubble', function(e){
 
              show_comment_form($(this));
 
          });
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -117,6 +117,12 @@
 
                  ${c.ignorews_url(request.GET, url_fid)}
 
                  ${c.context_url(request.GET, url_fid)}
 
                </div>
 
                <span style="float:right;margin-top:-3px">
 
                    <label>
 
                        ${_('Show inline comments')}
 
                        ${h.checkbox('',checked="checked",class_="show-inline-comments",id_for=url_fid)}
 
                    </label>
 
                </span>
 
            </div>
 
        </div>
 
        <div class="code-body full_f_path" data-f_path="${h.safe_unicode(filename)}">
 
@@ -179,6 +185,18 @@ $(document).ready(function(){
 
            $button.html("&darr; {0} &darr;".format(_TM['Expand Diff']));
 
        }
 
    });
 
    $('.show-inline-comments').change(function(e){
 
        var target = e.currentTarget;
 
        if(target == null){
 
            target = this;
 
        }
 
        var boxid = $(target).attr('id_for');
 
        if(target.checked){
 
            $('#{0} .inline-comments'.format(boxid)).show();
 
        }else{
 
            $('#{0} .inline-comments'.format(boxid)).hide();
 
        }
 
    });
 
});
 
</script>
 
</%def>
0 comments (0 inline, 0 general)