Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
43252ccb
Commit
43252ccb
authored
Aug 17, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tabs navigation and do not update URL via pushstate
parent
59fa031e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+4
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+7
-1
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+4
-7
No files found.
app/assets/javascripts/merge_request_tabs.js
View file @
43252ccb
...
...
@@ -15,6 +15,7 @@
function
MergeRequestTabs
(
opts
)
{
this
.
opts
=
opts
!=
null
?
opts
:
{};
this
.
opts
.
setUrl
=
this
.
opts
.
setUrl
!==
undefined
?
this
.
opts
.
setUrl
:
true
;
this
.
setCurrentAction
=
bind
(
this
.
setCurrentAction
,
this
);
this
.
tabShown
=
bind
(
this
.
tabShown
,
this
);
this
.
showTab
=
bind
(
this
.
showTab
,
this
);
...
...
@@ -58,7 +59,9 @@
}
else
{
this
.
expandView
();
}
return
this
.
setCurrentAction
(
action
);
if
(
this
.
opts
.
setUrl
)
{
this
.
setCurrentAction
(
action
);
}
};
MergeRequestTabs
.
prototype
.
scrollToElement
=
function
(
container
)
{
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
43252ccb
...
...
@@ -216,7 +216,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@base_commit
=
@merge_request
.
diff_base_commit
@diffs
=
@merge_request
.
diffs
(
diff_options
)
if
@merge_request
.
compare
@diff_notes_disabled
=
true
@show_diff_tab
=
check_diff_tab
@pipeline
=
@merge_request
.
pipeline
@statuses
=
@pipeline
.
statuses
.
relevant
if
@pipeline
...
...
@@ -520,4 +520,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
params
[
:merge_request
]
||=
ActionController
::
Parameters
.
new
(
source_project:
@project
)
@merge_request
=
MergeRequests
::
BuildService
.
new
(
project
,
current_user
,
merge_request_params
).
execute
end
private
def
check_diff_tab
request
.
query_parameters
[
:view
].
present?
end
end
app/views/projects/merge_requests/_new_submit.html.haml
View file @
43252ccb
...
...
@@ -20,7 +20,7 @@
.mr-compare.merge-request
%ul
.merge-request-tabs.nav-links.no-top.no-bottom
%li
.commits-tab
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'
commits
'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'
new
'
,
toggle:
'tab'
}
do
Commits
%span
.badge
=
@commits
.
size
-
if
@pipeline
...
...
@@ -52,11 +52,8 @@
$
(
'
#merge_request_assignee_id
'
).
val
(
"
#{
current_user
.
id
}
"
).
trigger
(
"
change
"
);
e
.
preventDefault
();
});
:javascript
var
merge_request
merge_request
=
new
MergeRequest
({
action
:
'
new
'
,
diffs_loaded
:
true
,
commits_loaded
:
true
var
merge_request
=
new
MergeRequest
({
action
:
"
#{
(
@show_diff_tab
?
'diffs'
:
'new'
)
}
"
,
setUrl
:
false
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment