Commit f089fd5f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7614 from yglukhov/toggle-line-wrap

Added a checkbox to toggle line wrapping in diff.
parents 070e3964 0bf45aec
$ ->
# Toggle line wrapping in diff.
#
# %div.diff-file
# %input.js-toggle-diff-line-wrap
# %td.line_content
#
$("body").on "click", ".js-toggle-diff-line-wrap", (e) ->
diffFile = $(@).closest(".diff-file")
if $(@).is(":checked")
diffFile.addClass("diff-wrap-lines")
else
diffFile.removeClass("diff-wrap-lines")
...@@ -125,8 +125,6 @@ ...@@ -125,8 +125,6 @@
} }
.line_content { .line_content {
display: block; display: block;
white-space: pre;
height: 18px;
margin: 0px; margin: 0px;
padding: 0px 0.5em; padding: 0px 0.5em;
border: none; border: none;
...@@ -341,3 +339,12 @@ ...@@ -341,3 +339,12 @@
margin: 0; margin: 0;
border: none; border: none;
} }
.diff-file .line_content {
white-space: pre;
}
.diff-wrap-lines .line_content {
white-space: pre-wrap;
}
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
%span.file-mode= "#{diff.a_mode}#{diff.b_mode}" %span.file-mode= "#{diff.a_mode}#{diff.b_mode}"
.diff-btn-group .diff-btn-group
%label
= check_box_tag nil, 1, false, class: "js-toggle-diff-line-wrap"
Wrap text
 
= link_to "#", class: "js-toggle-diff-comments btn btn-small" do = link_to "#", class: "js-toggle-diff-comments btn btn-small" do
%i.icon-chevron-down %i.icon-chevron-down
Diff comments Diff comments
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment