Fix double event and xhr request call on MR page !7298

On page merge_requests/n/diffs and merge_requests/n/commits 'shown.bs.tab' event triggers twice when tab is loading  which lead to  extra ajax request for data each time.
This commit prevent this event from triggering twice when tab is loading.
This commit is contained in:
Yar 2016-11-13 18:18:04 +03:00 committed by YarNayar
parent 7957b20405
commit 5b876592b4
2 changed files with 6 additions and 1 deletions

View File

@ -145,7 +145,8 @@
if (action === 'show') {
action = 'notes';
}
$(".merge-request-tabs a[data-action='" + action + "']").tab('show').trigger('shown.bs.tab');
// important note: the .tab('show') method triggers 'shown.bs.tab' event itself
$(".merge-request-tabs a[data-action='" + action + "']").tab('show');
};
// Replaces the current Merge Request-specific action in the URL with a new one

View File

@ -0,0 +1,4 @@
---
title: Fix double event and ajax request call on MR page
merge_request: 7298
author: YarNayar