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:
authorRobert Speicher <rspeicher@gmail.com>2015-07-19 01:05:07 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-07-19 01:05:07 +0300
commitf92bbd2f284530b0c05bc179a60ceb9751556026 (patch)
tree0ad0207e76823c15e17804e9d957bf254515d6ae /app/assets
parent26a9faab25d0dab1a9e126809f5a1bd9dca0a81f (diff)
Show the first tab automatically on MergeRequests#new
Closes #2013
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/merge_request.js.coffee12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index 7462975bd3d..b21cb7904b5 100644
--- a/app/assets/javascripts/merge_request.js.coffee
+++ b/app/assets/javascripts/merge_request.js.coffee
@@ -15,9 +15,7 @@ class @MergeRequest
this.$('.show-all-commits').on 'click', =>
this.showAllCommits()
- # `MergeRequests#new` has no tab-persisting or lazy-loading behavior
- unless @opts.action == 'new'
- new MergeRequestTabs(@opts)
+ @initTabs()
# Prevent duplicate event bindings
@disableTaskList()
@@ -29,6 +27,14 @@ class @MergeRequest
$: (selector) ->
this.$el.find(selector)
+ initTabs: ->
+ if @opts.action != 'new'
+ # `MergeRequests#new` has no tab-persisting or lazy-loading behavior
+ new MergeRequestTabs(@opts)
+ else
+ # Show the first tab (Commits)
+ $('.merge-request-tabs a[data-toggle="tab"]:first').tab('show')
+
showAllCommits: ->
this.$('.first-commits').remove()
this.$('.all-commits').removeClass 'hide'