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
This commit is contained in:
Alfredo Sumaran 2017-03-15 00:49:27 +00:00
commit 8fddde5b9f

View file

@ -21,8 +21,13 @@
// %a.js-toggle-button
// %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'));
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