Browse Source

Fix scroll into a footnotes

pull/111/head
janpaulo 4 years ago
parent
commit
ba95906f5c
No known key found for this signature in database
GPG Key ID: 50CA753050F1541C
  1. 6
      app/javascript/packs/application.js

6
app/javascript/packs/application.js

@ -36,6 +36,10 @@ $(document).on("ready turbolinks:load", function () {
$('#sidenav').toggleClass('active');
});
$("#toast-close").click(function(){
$('.toast').hide();
});
$(".spinner-border").hide();
var default_config = { altFormat: "m/d/Y", altInput: true, enableTime: false, dateFormat: "Y-m-d", isMobile: true };
@ -58,7 +62,7 @@ $(document).on("ready turbolinks:load", function () {
a = $(this), b = $(a.attr('href'))
if(b.length<=0)return
event.preventDefault()
$('html, body, .tab-content').animate({ scrollTop: b.offset().top }, 700, 'linear')
document.getElementById(b[0].id).scrollIntoView( {behavior: "smooth", duration: 700 })
})
});

Loading…
Cancel
Save