Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f089fd5f
Commit
f089fd5f
authored
Aug 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7614 from yglukhov/toggle-line-wrap
Added a checkbox to toggle line wrapping in diff.
parents
070e3964
0bf45aec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
app/assets/javascripts/behaviors/toggle_diff_line_wrap_behavior.coffee
...vascripts/behaviors/toggle_diff_line_wrap_behavior.coffee
+14
-0
app/assets/stylesheets/sections/diff.scss
app/assets/stylesheets/sections/diff.scss
+9
-2
app/views/projects/commits/_diff_file.html.haml
app/views/projects/commits/_diff_file.html.haml
+4
-0
No files found.
app/assets/javascripts/behaviors/toggle_diff_line_wrap_behavior.coffee
0 → 100644
View file @
f089fd5f
$
->
# 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"
)
app/assets/stylesheets/sections/diff.scss
View file @
f089fd5f
...
...
@@ -125,8 +125,6 @@
}
.line_content
{
display
:
block
;
white-space
:
pre
;
height
:
18px
;
margin
:
0px
;
padding
:
0px
0
.5em
;
border
:
none
;
...
...
@@ -341,3 +339,12 @@
margin
:
0
;
border
:
none
;
}
.diff-file
.line_content
{
white-space
:
pre
;
}
.diff-wrap-lines
.line_content
{
white-space
:
pre-wrap
;
}
app/views/projects/commits/_diff_file.html.haml
View file @
f089fd5f
...
...
@@ -16,6 +16,10 @@
%span
.file-mode
=
"
#{
diff
.
a_mode
}
→
#{
diff
.
b_mode
}
"
.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
%i
.icon-chevron-down
Diff comments
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment