Commits

Anonymous committed 525d3e3

#401: add a "Show/Hide History" button that (un)folds the history.

Comments (0)

Files changed (2)

html/issue.item.html

 </title>
 
 <metal:slot fill-slot="more-javascript">
+<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
 <script type="text/javascript" src="@@file/issue.item.js"></script>
 </metal:slot>
 

html/issue.item.js

     nosy.style.display = 'inline';
     nosy.style.width = new_width + "px";
 }
+
+$(document).ready(function() {
+    /* Add a "Show/Hide history" button that (un)folds the history. See #401 */
+    var th = $('<td colspan="4">Show History</td>');
+    th.css({'cursor': 'pointer', 'text-align': 'center',
+            'border': '1px solid #ccc'});
+    /* select and hide all the tr except the first one ("History") */
+    $('table.history tr:not(:first-child)').toggle();
+    th.click(function() {
+        $('table.history tr:not(:first-child)').toggle();
+        th.text(th.text() == 'Show History' ? 'Hide History' : 'Show History');
+    });
+    $('table.history').append(th.wrap('<tr id="togglehistory" />'));
+})