[FIX] website: never hide countdowns with redirect action in edit mode

When editing a countdown with a redirect action, sometimes the
countdown block will be hidden when toggling the "Hide countdown at the
end" option.

The problem is caused by the button that allows previewing
and editing the end message of the countdown, this button does not
apply in the case of a redirect action though. However, the button can
still be activated by selecting a different end action first and
switching to the redirect action afterwards, in which case it will
incorrectly hide the countdown.

task-2638366

closes odoo/odoo#81557

X-original-commit: 7f6ebee33e8a82d7ccdf155c3a543898b187389c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Tom De Caluwé
2021-12-17 09:18:08 +00:00
committed by qsm-odoo
parent 9e5d149527
commit e9f72aa643
@@ -41,6 +41,9 @@ options.registry.countdown = options.Class.extend({
this.$target.toggleClass('hide-countdown', widgetValue === 'message_no_countdown');
} else {
const $message = this.$target.find('.s_countdown_end_message').detach();
if (this.showEndMessage) {
this._onToggleEndMessageClick();
}
if ($message.length) {
this.endMessage = $message[0].outerHTML;
}