[FIX] web_editor: scroll to the bottom of link options

Before, only the url input was focused when initializing the link
tools.

Now, we also scroll to the bottom of the options so that the user
directly has access to them.

Part of https://github.com/odoo/odoo/pull/71909
task-2542318

closes odoo/odoo#72122

X-original-commit: 748418d95059ad7ed5638aa4e4aca76da30fa6b3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Younn Olivier
2021-06-14 11:09:05 +00:00
parent c6ed10f020
commit dfe699efe9
@@ -3,6 +3,7 @@ odoo.define('wysiwyg.widgets.LinkTools', function (require) {
const Link = require('wysiwyg.widgets.Link');
const OdooEditorLib = require('web_editor.odoo-editor');
const dom = require('web.dom');
const setCursor = OdooEditorLib.setCursor;
@@ -34,7 +35,9 @@ const LinkTools = Link.extend({
this.options.wysiwyg.odooEditor.observerUnactive();
this.$link.addClass('oe_edited_link');
this.$button.addClass('active');
return this._super(...arguments);
return this._super(...arguments).then(() => {
dom.scrollTo(this.$(':visible:last')[0], {duration: 0});
});
},
destroy: function () {
$('.oe_edited_link').removeClass('oe_edited_link');