diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-26 01:33:24 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-26 01:33:24 +0300 |
commit | 4e7f23fe0bcb547109d369a7e32db170049d0f21 (patch) | |
tree | 47408b581af77d0ee5ade559f4316b272300fdd3 /app/assets | |
parent | 6288677134d0e6d1f805748bc557091ad4747bd9 (diff) |
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
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js.coffee | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index de9a4c2cc2f..918936a9eb9 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -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 |