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:
parent
7957b20405
commit
5b876592b4
|
@ -145,7 +145,8 @@
|
||||||
if (action === 'show') {
|
if (action === 'show') {
|
||||||
action = 'notes';
|
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
|
// Replaces the current Merge Request-specific action in the URL with a new one
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Fix double event and ajax request call on MR page
|
||||||
|
merge_request: 7298
|
||||||
|
author: YarNayar
|
Loading…
Reference in New Issue