js: fix errors on browsers not supporting window.scroll options

IE and Safari only know about `window.scroll(x, y)`, and not the form
with options.
This commit is contained in:
Pierre de La Morinerie 2020-04-06 16:49:37 +02:00
parent 6dbbaf9528
commit 52afb41bab

View file

@ -1,3 +1,7 @@
try {
window.scroll({ top: 0, left: 0, behavior: 'smooth' }); window.scroll({ top: 0, left: 0, behavior: 'smooth' });
} catch {
window.scroll(0, 0);
}
<%= remove_element('#user-satisfaction') %> <%= remove_element('#user-satisfaction') %>
<%= render_flash %> <%= render_flash %>