diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-07-18 18:05:07 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-07-18 18:05:07 -0400 |
commit | f92bbd2f284530b0c05bc179a60ceb9751556026 (patch) | |
tree | 0ad0207e76823c15e17804e9d957bf254515d6ae /app | |
parent | 26a9faab25d0dab1a9e126809f5a1bd9dca0a81f (diff) | |
download | gitlab-ce-f92bbd2f284530b0c05bc179a60ceb9751556026.tar.gz |
Show the first tab automatically on MergeRequests#newrs-issue-2013
Closes #2013
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/merge_request.js.coffee | 12 |
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' |