[IMP] website: keep focus on snippet when moving up or down

Part of https://github.com/odoo/odoo/pull/51236
task-2176020
This commit is contained in:
Laurent Stukkens (LTU)
2020-06-12 20:07:51 +00:00
committed by qsm-odoo
parent 5b7317b53f
commit 8a0a17fab9
@@ -2026,6 +2026,15 @@ options.registry.SnippetMove = options.Class.extend({
}
break;
}
if (params.name === 'move_up_opt' || params.name === 'move_down_opt') {
$('html, body').animate(
{
scrollTop: this.$target.offset().top - $(window).height() / 2,
},
500,
'linear',
);
}
},
});