From dfe699efe952cb38d8774c8f70b560beca7fe763 Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Fri, 28 May 2021 14:02:27 +0000 Subject: [PATCH] [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) --- .../web_editor/static/src/js/wysiwyg/widgets/link_tools.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js b/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js index 90a50bfcb3d..c5b1dbd653e 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js @@ -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');