changeset 4351:f22d103ba9e8

changelog: use css for message expand and make it toggle so it also can be collapsed again
author Mads Kiilerich <madski@unity3d.com>
date Fri, 18 Jul 2014 18:45:54 +0200
parents 03d129da0e17
children c733124b6262
files kallithea/public/css/style.css kallithea/templates/changelog/changelog.html kallithea/templates/compare/compare_cs.html kallithea/tests/functional/test_compare.py
diffstat 4 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/css/style.css	Fri Jul 18 18:44:54 2014 +0200
+++ b/kallithea/public/css/style.css	Fri Jul 18 18:45:54 2014 +0200
@@ -2635,6 +2635,18 @@
     height: 1.1em;
 }
 
+#graph_content_pr .compare_view_commits .message {
+    white-space: normal !important;
+    padding: 0 !important;
+    height: 1.1em;
+}
+
+#graph_content .container .mid .message.expanded,
+#graph_content_pr .compare_view_commits .message.expanded {
+    height: auto;
+    margin: 4px 0px 4px 0px;
+}
+
 #graph_content .container .extra-container {
     display: block;
     position: absolute;
--- a/kallithea/templates/changelog/changelog.html	Fri Jul 18 18:44:54 2014 +0200
+++ b/kallithea/templates/changelog/changelog.html	Fri Jul 18 18:45:54 2014 +0200
@@ -259,9 +259,8 @@
                 }
 
                 $('.expand_commit').on('click',function(e){
-                    $(this).children('i').hide();
                     var cid = $(this).attr('commit_id');
-                    $('#C-'+cid).css({'height': 'auto', 'margin': '4px 0px 4px 0px'})
+                    $('#C-'+cid).toggleClass('expanded');
 
                     //redraw the graph, r and jsdata are bound outside function
                     r.render(jsdata,100);
--- a/kallithea/templates/compare/compare_cs.html	Fri Jul 18 18:44:54 2014 +0200
+++ b/kallithea/templates/compare/compare_cs.html	Fri Jul 18 18:45:54 2014 +0200
@@ -32,7 +32,7 @@
         <td class="expand_commit" commit_id="${cs.raw_id}" title="${_('Expand commit message')}">
             <i class="icon-resize-vertical" style="color:#DDD"></i>
         </td>
-        <td><div id="C-${cs.raw_id}" class="message" style="white-space:normal; height:1.1em; padding:0">${h.urlify_commit(cs.message, c.repo_name)}</div></td>
+        <td><div id="C-${cs.raw_id}" class="message">${h.urlify_commit(cs.message, c.repo_name)}</div></td>
         </tr>
     %endfor
     </table>
@@ -72,9 +72,8 @@
 
 <script>
 $('.expand_commit').on('click',function(e){
-    $(this).children('i').hide();
     var cid = $(this).attr('commit_id');
-    $('#C-'+cid).css({'height': 'auto','width': 'auto', 'white-space': 'pre'})
+    $('#C-'+cid).toggleClass('expanded');
 });
 $('.gravatar').on('click',function(e){
     var cid = $(this).attr('commit_id');
--- a/kallithea/tests/functional/test_compare.py	Fri Jul 18 18:44:54 2014 +0200
+++ b/kallithea/tests/functional/test_compare.py	Fri Jul 18 18:45:54 2014 +0200
@@ -42,7 +42,7 @@
 
 
 def _commit_div(sha, msg):
-    return """<div id="C-%s" class="message" style="white-space:normal; height:1.1em; padding:0">%s</div>""" % (sha, msg)
+    return """<div id="C-%s" class="message">%s</div>""" % (sha, msg)
 
 
 class TestCompareController(TestController):