From a8d1a9a782ab35bfeb4c25ede30b0e95d663fc2c Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Wed, 15 Jan 2020 12:17:04 +0000 Subject: [PATCH] [IMP] web_tour: add new "text_blur" action for tours' run method The 'text' helper does not focus out of the inputs after adding the text. The new 'text_blur' one will. It will be needed for future tasks of the website editor since the inputs in the left panel are only considered on blur or on ENTER. See https://github.com/odoo/odoo/pull/42189 for example. closes odoo/odoo#43337 Signed-off-by: Aaron Bohy (aab) --- .../web_tour/static/src/js/running_tour_action_helper.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web_tour/static/src/js/running_tour_action_helper.js b/addons/web_tour/static/src/js/running_tour_action_helper.js index 794f346e750..a034d506622 100644 --- a/addons/web_tour/static/src/js/running_tour_action_helper.js +++ b/addons/web_tour/static/src/js/running_tour_action_helper.js @@ -28,6 +28,9 @@ var RunningTourActionHelper = core.Class.extend({ text: function (text, element) { this._text(this._get_action_values(element), text); }, + text_blur: function (text, element) { + this._text_blur(this._get_action_values(element), text); + }, drag_and_drop: function (to, element) { this._drag_and_drop(this._get_action_values(element), to); }, @@ -106,6 +109,11 @@ var RunningTourActionHelper = core.Class.extend({ } values.$element.trigger("change"); }, + _text_blur: function (values, text) { + this._text(values, text); + values.$element.trigger('focusout'); + values.$element.trigger('blur'); + }, _drag_and_drop: function (values, to) { var $to; if (to) {