diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-09 00:28:28 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-09 00:28:28 +0300 |
commit | 23b6a98de00b966728f6b5ed3747b0d2e078165f (patch) | |
tree | 0f61c95ff08c4f44b1ba2779d788766034e634c0 /app/assets/javascripts/merge_request_tabs.js.coffee | |
parent | 6c94a44295eec5efff87102fecffc2ac03ee560d (diff) |
Move Builds tab to the end
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js.coffee')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js.coffee | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index 69a12fdd045..b0eeb1db536 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -68,10 +68,10 @@ class @MergeRequestTabs if action == 'commits' @loadCommits($target.attr('href')) - else if action == 'builds' - @loadBuilds($target.attr('href')) else if action == 'diffs' @loadDiff($target.attr('href')) + else if action == 'builds' + @loadBuilds($target.attr('href')) @setCurrentAction(action) @@ -110,7 +110,7 @@ class @MergeRequestTabs action = 'notes' if action == 'show' # Remove a trailing '/commits' or '/diffs' - new_state = @_location.pathname.replace(/\/(commits|builds|diffs)(\.html)?\/?$/, '') + new_state = @_location.pathname.replace(/\/(commits|diffs|builds)(\.html)?\/?$/, '') # Append the new action if we're on a tab other than 'notes' unless action == 'notes' @@ -138,6 +138,16 @@ class @MergeRequestTabs @commitsLoaded = true @scrollToElement("#commits") + loadDiff: (source) -> + return if @diffsLoaded + + @_get + url: "#{source}.json" + @_location.search + success: (data) => + document.getElementById('diffs').innerHTML = data.html + @diffsLoaded = true + @scrollToElement("#diffs") + loadBuilds: (source) -> return if @buildsLoaded @@ -149,16 +159,6 @@ class @MergeRequestTabs @buildsLoaded = true @scrollToElement("#builds") - loadDiff: (source) -> - return if @diffsLoaded - - @_get - url: "#{source}.json" + @_location.search - success: (data) => - document.getElementById('diffs').innerHTML = data.html - @diffsLoaded = true - @scrollToElement("#diffs") - # Show or hide the loading spinner # # status - Boolean, true to show, false to hide |