Changeset - 3c1cdd1c1736
[Not reviewed]
default
0 2 0
Mads Kiilerich - 8 years ago 2017-08-24 02:50:04
mads@kiilerich.com
changelog: simplify message expansion toggling

Slightly simpler, slightly less html, slightly smaller DOM.
2 files changed with 6 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -104,12 +104,12 @@ ${self.repo_context_bar('changelog', c.f
 
                        <td class="date">
 
                            <div class="date" data-toggle="tooltip" title="${h.fmt_date(cs.date)}">${h.age(cs.date,True)}</div>
 
                        </td>
 
                        <td class="expand_commit" data-commit_id="${cs.raw_id}" title="${_('Expand commit message')}">
 
                        <td class="expand_commit" title="${_('Expand commit message')}">
 
                            <i class="icon-align-left"></i>
 
                        </td>
 
                        <td class="mid">
 
                            <div class="log-container">
 
                                <div class="message" id="C-${cs.raw_id}">${h.urlify_text(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
                                <div class="message">${h.urlify_text(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
                                <div class="extra-container">
 
                                    %if c.comments.get(cs.raw_id):
 
                                        <a class="comments-container comments-cnt" href="${c.comments[cs.raw_id][0].url()}" data-toggle="tooltip" title="${_('%s comments') % len(c.comments[cs.raw_id])}">
 
@@ -286,8 +286,7 @@ ${self.repo_context_bar('changelog', c.f
 
                });
 

	
 
                $('.expand_commit').on('click',function(e){
 
                    var cid = $(this).data('commit_id');
 
                    $('#C-'+cid).toggleClass('expanded');
 
                    $(this).next('.mid').find('.message').toggleClass('expanded');
 

	
 
                    //redraw the graph, r and jsdata are bound outside function
 
                    graph.render(jsdata);
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -73,7 +73,7 @@
 
        <span class="branchtag">${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.cs_repo.repo_name,branch=cs.branch))}</span>
 
        %endif
 
        </td>
 
        <td class="expand_commit" data-commit_id="${cs.raw_id}" title="${_('Expand commit message')}">
 
        <td class="expand_commit" title="${_('Expand commit message')}">
 
            <i class="icon-align-left"></i>
 
        </td>
 
        <td class="mid">
 
@@ -84,7 +84,7 @@
 
                    </span>
 
                %endfor
 
            </div>
 
            <div id="C-${cs.raw_id}" class="message">${h.urlify_text(cs.message, c.repo_name)}</div>
 
            <div class="message">${h.urlify_text(cs.message, c.repo_name)}</div>
 
        </td>
 
      </tr>
 
    %endfor
 
@@ -132,8 +132,7 @@
 
        graph.render(jsdata);
 

	
 
        $('.expand_commit').click(function(e){
 
            var cid = $(this).data('commit_id');
 
            $('#C-'+cid).toggleClass('expanded');
 
            $(this).next('.mid').find('.message').toggleClass('expanded');
 
            graph.render(jsdata);
 
        });
 
    });
0 comments (0 inline, 0 general)