Commit 8fddde5b authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch '29414-fix-toggle-disccusion-link-jump-pick-into-9-0' into 'master'

Fix link togglers jumping to top

Closes #29414

See merge request !9943
parents 2a3127d0 f97c1d10
Pipeline #7022405 passed with stages
in 137 minutes and 48 seconds
...@@ -21,8 +21,13 @@ ...@@ -21,8 +21,13 @@
// %a.js-toggle-button // %a.js-toggle-button
// %div.js-toggle-content // %div.js-toggle-content
// //
$('body').on('click', '.js-toggle-button', function() { $('body').on('click', '.js-toggle-button', function(e) {
toggleContainer($(this).closest('.js-toggle-container')); toggleContainer($(this).closest('.js-toggle-container'));
const targetTag = e.target.tagName.toLowerCase();
if (targetTag === 'a' || targetTag === 'button') {
e.preventDefault();
}
}); });
// If we're accessing a permalink, ensure it is not inside a // If we're accessing a permalink, ensure it is not inside a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment