Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

코드 접기기능 추가 #935

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/assets/stylesheets/less/_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -5333,11 +5333,20 @@ label.issue-item-row {
white-space: nowrap;
word-break : break-all;
margin-right: 115px;
display: inline-block;
vertical-algin: middle;

.filename {
color:@base-text-color;
font-size:@base-font-size;
}
button {
position: absolute;
background:transparent;
border:0;
outline:0 none;
right: 10px;
}
}

.diff-partial-utility {
Expand Down
24 changes: 23 additions & 1 deletion app/views/partial_filediff.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,30 @@
}
</div>
</div>
<script type="text/javascript">
$(function(){
var tbody = document.getElementById('@routes.CodeApp.codeBrowserWithBranch(projectB.owner, projectB.name, diff.commitB, diff.pathB)');
if(localStorage.getItem('@routes.CodeApp.codeBrowserWithBranch(projectB.owner, projectB.name, diff.commitB, diff.pathB)') == 'folded'){
tbody.style.display = 'none';
} else {
tbody.style.display = '';
localStorage.setItem('@routes.CodeApp.codeBrowserWithBranch(projectB.owner, projectB.name, diff.commitB, diff.pathB)', 'notfolded');
}
});
function foldFileCode(fileId) {
var tbody = document.getElementById(fileId);
if(localStorage.getItem(fileId) == 'notfolded'){
tbody.style.display = 'none';
localStorage.setItem(fileId,'folded');
} else {
tbody.style.display = '';
localStorage.setItem(fileId, 'notfolded');
}
}
</script>
<div class="diff-partial-file">
<span class="filename" >@fileHeader</span>
<button type="button" onclick="foldFileCode('@routes.CodeApp.codeBrowserWithBranch(projectB.owner, projectB.name, diff.commitB, diff.pathB)');"><i class="yobicon-minus-circle-alt"></i></button>
</div>
</div>
<div class="diff-partial-code" data-hashcode="@diff.hashCode">
Expand All @@ -164,7 +186,7 @@
data-path-a="@diff.pathA" data-path-b="@diff.pathB"
data-commit-a="@diff.commitA" data-commit-b="@diff.commitB"
data-file-path="@StringUtils.defaultIfEmpty(diff.pathB, diff.pathA)">
<tbody>
<tbody id="@routes.CodeApp.codeBrowserWithBranch(projectB.owner, projectB.name, diff.commitB, diff.pathB)">
@renderedLines
</tbody>
</table>
Expand Down