Fix "N changed files" link toggler jumping to top

Thanks for the spot @DouweM
https://gitlab.slack.com/archives/C0GQHHPGW/p1490132124022958

See previous MR
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9943

See subsequent MR
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9918

Togglers to check:

 - "Create a Mattermost team for this group" Checkbox,
   http://localhost:3000/groups/new (enable `mattermost` in
`config/gitlab.yml`)
 - "Repo by Url" button, http://localhost:3000/projects/new
 - In MR widget "Modify commit message",
   http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/9
 - Discussion "Toggle discussion",
   http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/3
 - "Showing **1 changed file** with 4 additions and 7 deletions" ,
   http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/3/diffs
 - Commit description toggle "...",
   http://localhost:3000/gitlab-org/gitlab-ce/commits/master
This commit is contained in:
Eric Eastwood 2017-03-21 16:57:12 -05:00
parent 45a2f9009b
commit d4c8e84787

View file

@ -24,7 +24,7 @@
$('body').on('click', '.js-toggle-button', function(e) {
toggleContainer($(this).closest('.js-toggle-container'));
const targetTag = e.target.tagName.toLowerCase();
const targetTag = e.currentTarget.tagName.toLowerCase();
if (targetTag === 'a' || targetTag === 'button') {
e.preventDefault();
}