Move script inside of MergeRequestTabs class
This commit is contained in:
parent
a4e522a889
commit
4d23af7507
2 changed files with 10 additions and 12 deletions
|
@ -225,16 +225,6 @@ $ ->
|
||||||
if $gutterIcon.hasClass('fa-angle-double-right')
|
if $gutterIcon.hasClass('fa-angle-double-right')
|
||||||
$gutterIcon.closest('a').trigger('click')
|
$gutterIcon.closest('a').trigger('click')
|
||||||
|
|
||||||
$(document)
|
|
||||||
.off 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]'
|
|
||||||
.on 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]', (e) ->
|
|
||||||
action = $(e.target).attr("data-action")
|
|
||||||
if action is 'diffs'
|
|
||||||
$gutterIcon = $('.gutter-toggle').find('i')
|
|
||||||
if $gutterIcon.hasClass('fa-angle-double-right')
|
|
||||||
$gutterIcon.closest('a').trigger('click')
|
|
||||||
|
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.off 'click', 'aside .gutter-toggle'
|
.off 'click', 'aside .gutter-toggle'
|
||||||
.on 'click', 'aside .gutter-toggle', (e) ->
|
.on 'click', 'aside .gutter-toggle', (e) ->
|
||||||
|
|
|
@ -70,6 +70,7 @@ class @MergeRequestTabs
|
||||||
@loadCommits($target.attr('href'))
|
@loadCommits($target.attr('href'))
|
||||||
else if action == 'diffs'
|
else if action == 'diffs'
|
||||||
@loadDiff($target.attr('href'))
|
@loadDiff($target.attr('href'))
|
||||||
|
@shrinkView()
|
||||||
else if action == 'builds'
|
else if action == 'builds'
|
||||||
@loadBuilds($target.attr('href'))
|
@loadBuilds($target.attr('href'))
|
||||||
|
|
||||||
|
@ -185,3 +186,10 @@ class @MergeRequestTabs
|
||||||
|
|
||||||
expandViewContainer: ->
|
expandViewContainer: ->
|
||||||
$('.container-fluid').removeClass('container-limited')
|
$('.container-fluid').removeClass('container-limited')
|
||||||
|
|
||||||
|
shrinkView: ->
|
||||||
|
$gutterIcon = $('.gutter-toggle i')
|
||||||
|
|
||||||
|
# Only when sidebar is collapsed
|
||||||
|
if $gutterIcon.is('.fa-angle-double-right')
|
||||||
|
$gutterIcon.closest('a').trigger('click')
|
||||||
|
|
Loading…
Reference in a new issue