Make pull request collapsable per file (#2405)

This commit is contained in:
SIkebe
2019-12-10 11:08:57 +09:00
committed by Naoki Takezoe
parent 9e19821256
commit a943a5985d
2 changed files with 19 additions and 1 deletions

View File

@@ -49,6 +49,7 @@
<table class="table table-bordered diff-outside" commitId="@newCommitId" fileName="@diff.newPath" data-diff-id="@i">
<tr>
<th style="font-weight: normal;" class="box-header">
<i class="fa fa-chevron-down rotate" data-toggle="collapse" data-target=".diff-collapse-@i" aria-hidden="true" style="cursor: pointer; font-size: 12px"></i>
@if(diff.changeType == ChangeType.COPY || diff.changeType == ChangeType.RENAME){
@if(newCommitId.isDefined){
<div class="pull-right align-right">
@@ -92,7 +93,7 @@
}
</th>
</tr>
<tr>
<tr class="diff-collapse-@i collapse in">
<td style="padding: 0;">
@if(diff.oldObjectId == diff.newObjectId){
@if(diff.oldPath != diff.newPath){
@@ -139,6 +140,17 @@
<script type="text/javascript" src="@helpers.assets("/vendors/jsdifflib/difflib.js")"></script>
<link href="@helpers.assets("/vendors/jsdifflib/diffview.css")" type="text/css" rel="stylesheet" />
<script>
$(".rotate").click(function(){
if($(this).hasClass('fa-chevron-right')) {
$(this).removeClass('fa-chevron-right');
$(this).addClass('fa-chevron-down');
} else {
$(this).removeClass('fa-chevron-down');
$(this).addClass('fa-chevron-right');
}
});
$(function(){
@if(showIndex){
$('#toggle-file-list').click(function(){

View File

@@ -981,6 +981,12 @@ div.pullreq-info {
padding: 8px;
}
.collapsing {
-webkit-transition: none;
transition: none;
display: none;
}
/****************************************************************************/
/* Wiki */
/****************************************************************************/