diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js index 91139aa0926..adda440df79 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js @@ -126,7 +126,6 @@ var StatementRenderer = Widget.extend(FieldManagerMixin, { type: 'rainbow_man', fadeout: 'no', message: $done, - click_close: false, }); this.$el.css('min-height', '450px'); } diff --git a/addons/web/static/src/js/widgets/rainbow_man.js b/addons/web/static/src/js/widgets/rainbow_man.js index 16d4d9a1e3d..e46201584bc 100644 --- a/addons/web/static/src/js/widgets/rainbow_man.js +++ b/addons/web/static/src/js/widgets/rainbow_man.js @@ -33,8 +33,6 @@ var RainbowMan = Widget.extend({ * [options.fadeout='no'] will keep rainbowman on screen until user clicks * anywhere outside rainbowman * @param {string} [options.img_url] URL of the image to be displayed - * @param {boolean} [options.click_close=true] If true, destroys rainbowman on - * click outside */ init: function (options) { this._super.apply(this, arguments); @@ -43,23 +41,19 @@ var RainbowMan = Widget.extend({ fadeout: 'medium', img_url: '/web/static/src/img/smile.svg', message: _t('Well Done!'), - click_close: true, }); this.delay = rainbowDelay[this.options.fadeout]; - core.bus.on('clear_uncommitted_changes', this, this.destroy); }, /** * @override */ start: function () { var self = this; - if (this.options.click_close) { - core.bus.on('click', this, function (ev) { - if (ev.originalEvent && ev.target.className.indexOf('o_reward') === -1) { - this.destroy(); - } - }); - } + core.bus.on('click', this, function (ev) { + if (ev.originalEvent && ev.target.className.indexOf('o_reward') === -1) { + this.destroy(); + } + }); if (this.delay) { setTimeout(function () { self.$el.addClass('o_reward_fading'); diff --git a/addons/web/static/tests/widgets/rainbow_man_tests.js b/addons/web/static/tests/widgets/rainbow_man_tests.js index b9ccef662c9..ad265416f3c 100644 --- a/addons/web/static/tests/widgets/rainbow_man_tests.js +++ b/addons/web/static/tests/widgets/rainbow_man_tests.js @@ -9,7 +9,6 @@ QUnit.module('RainbowMan', { beforeEach: function () { this.data = { message: 'Congrats!', - click_close: false }; }, }, function () { diff --git a/addons/web_tour/static/src/js/tour_manager.js b/addons/web_tour/static/src/js/tour_manager.js index 54f51f0bbc6..599e6c6b2f5 100644 --- a/addons/web_tour/static/src/js/tour_manager.js +++ b/addons/web_tour/static/src/js/tour_manager.js @@ -416,13 +416,13 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, { _consume_tour: function (tour_name, error) { delete this.active_tooltips[tour_name]; //display rainbow at the end of any tour - if (this.tours[tour_name].rainbowMan && this.running_tour !== tour_name - && this.tours[tour_name].current_step === this.tours[tour_name].steps.length) { + if (this.tours[tour_name].rainbowMan && this.running_tour !== tour_name && + this.tours[tour_name].current_step === this.tours[tour_name].steps.length) { var $rainbow_message = $('' + 'Good job!' + ' You went through all steps of this tour.' + ''); - new RainbowMan({message: $rainbow_message, click_close: false}).appendTo(this.$body); + new RainbowMan({message: $rainbow_message}).appendTo(this.$body); } this.tours[tour_name].current_step = 0; local_storage.removeItem(get_step_key(tour_name));