Reorder MergeRequestTabs constructor
The tab was being activated before we set the `[commits|diffs]Loaded` variable, so even when the `/diffs` route is accessed directly, like from the "Side-by-side" link, the tab was being loaded from its default source. Fixes #1887
This commit is contained in:
parent
6288677134
commit
4e7f23fe0b
|
@ -49,13 +49,13 @@ class @MergeRequestTabs
|
|||
# Store the `location` object, allowing for easier stubbing in tests
|
||||
@_location = location
|
||||
|
||||
@bindEvents()
|
||||
@activateTab(@opts.action)
|
||||
|
||||
switch @opts.action
|
||||
when 'commits' then @commitsLoaded = true
|
||||
when 'diffs' then @diffsLoaded = true
|
||||
|
||||
@bindEvents()
|
||||
@activateTab(@opts.action)
|
||||
|
||||
bindEvents: ->
|
||||
$(document).on 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]', @tabShown
|
||||
|
||||
|
|
Loading…
Reference in New Issue