Commit 32e593c6 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett Committed by Sean McGivern

review changes

parent ea1827c9
class @Diff class @Diff
UNFOLD_COUNT = 20 UNFOLD_COUNT = 20
constructor: -> constructor: ->
$('.files .diff-file').singleDiff() $('.files .diff-file').singleFileDiff()
$(document).off('click', '.js-unfold') $(document).off('click', '.js-unfold')
$(document).on('click', '.js-unfold', (event) => $(document).on('click', '.js-unfold', (event) =>
......
...@@ -160,7 +160,7 @@ class @MergeRequestTabs ...@@ -160,7 +160,7 @@ class @MergeRequestTabs
$('#diffs').html data.html $('#diffs').html data.html
gl.utils.localTimeAgo($('.js-timeago', 'div#diffs')) gl.utils.localTimeAgo($('.js-timeago', 'div#diffs'))
$('#diffs .js-syntax-highlight').syntaxHighlight() $('#diffs .js-syntax-highlight').syntaxHighlight()
$('#diffs .diff-file').singleDiff() $('#diffs .diff-file').singleFileDiff()
@expandViewContainer() if @diffViewType() is 'parallel' @expandViewContainer() if @diffViewType() is 'parallel'
@diffsLoaded = true @diffsLoaded = true
@scrollToElement("#diffs") @scrollToElement("#diffs")
......
class @SingleDiff class @SingleFileDiff
WRAPPER = '<div class="diff-content diff-wrap-lines"></div>' WRAPPER = '<div class="diff-content diff-wrap-lines"></div>'
LOADING_HTML = '<i class="fa fa-spinner fa-spin"></i>' LOADING_HTML = '<i class="fa fa-spinner fa-spin"></i>'
...@@ -24,7 +24,6 @@ class @SingleDiff ...@@ -24,7 +24,6 @@ class @SingleDiff
$('.file-title > a', @file).on 'click', @toggleDiff $('.file-title > a', @file).on 'click', @toggleDiff
toggleDiff: (e) => toggleDiff: (e) =>
e.preventDefault()
@isOpen = !@isOpen @isOpen = !@isOpen
if not @isOpen and not @hasError if not @isOpen and not @hasError
@content.hide() @content.hide()
...@@ -49,7 +48,7 @@ class @SingleDiff ...@@ -49,7 +48,7 @@ class @SingleDiff
@collapsedContent.after(@content) @collapsedContent.after(@content)
return return
$.fn.singleDiff = -> $.fn.singleFileDiff = ->
return @each -> return @each ->
if not $.data this, 'singleDiff' if not $.data this, 'singleFileDiff'
$.data this, 'singleDiff', new SingleDiff this $.data this, 'singleFileDiff', new SingleFileDiff this
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
font-weight: normal; font-weight: normal;
font-size: 16px; font-size: 16px;
line-height: 36px; line-height: 36px;
&.diff-collapsed {
cursor: pointer;
}
} }
.row-content-block { .row-content-block {
......
...@@ -189,7 +189,3 @@ span.idiff { ...@@ -189,7 +189,3 @@ span.idiff {
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
} }
} }
.nothing-here-block.diff-collapsed {
cursor: pointer;
}
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