Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-07-22 03:37:33 +0300
committerStan Hu <stanhu@gmail.com>2015-07-23 22:53:54 +0300
commitae3f869fd1f4326e26805606197dea4ea15c67bb (patch)
tree725ec9afb838a3b083db5ad97a6d1dbd4ba46b8a /app/assets
parent5dd4dea93baa6386ed860a50125dce3ca3890f16 (diff)
Fix the "Reload with full diff" URL button
On the first load, the merge request tabs would be requested in JSON format to render the HTML. This would cause the "Reload with full diff" button to create a link to diff.json. Closes #2041
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/merge_request_tabs.js.coffee10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee
index a132a0a9dcc..19a07b6a033 100644
--- a/app/assets/javascripts/merge_request_tabs.js.coffee
+++ b/app/assets/javascripts/merge_request_tabs.js.coffee
@@ -49,12 +49,6 @@ class @MergeRequestTabs
# Store the `location` object, allowing for easier stubbing in tests
@_location = location
- switch @opts.action
- when 'commits'
- @commitsLoaded = true
- when 'diffs'
- @diffsLoaded = true
-
@bindEvents()
@activateTab(@opts.action)
@@ -102,7 +96,7 @@ class @MergeRequestTabs
action = 'notes' if action == 'show'
# Remove a trailing '/commits' or '/diffs'
- new_state = @_location.pathname.replace(/\/(commits|diffs)\/?$/, '')
+ new_state = @_location.pathname.replace(/\/(commits|diffs)(\.html)?\/?$/, '')
# Append the new action if we're on a tab other than 'notes'
unless action == 'notes'
@@ -133,7 +127,7 @@ class @MergeRequestTabs
return if @diffsLoaded
@_get
- url: "#{source}.json"
+ url: "#{source}.json" + @_location.search
success: (data) =>
document.getElementById('diffs').innerHTML = data.html
@diffsLoaded = true