Skip to content
Snippets Groups Projects
Commit 7e948297 authored by fja-odoo's avatar fja-odoo
Browse files

[IMP] website: add countdown urlpicker placeholder

No default url on countdown's urlpicker anymore. Only a placeholder.
Also redirect to homepage if no url.

Part of: https://github.com/odoo/odoo/pull/46640



task-2210358

closes odoo/odoo#47235

X-original-commit: a0d983e94e3681a3f3e55cc445defc1ec862c606
Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 52ac740a
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ const CountdownWidget = publicWidget.Widget.extend({
*/
_handleEndCountdownAction: function () {
if (this.endAction === 'redirect') {
const redirectUrl = this.el.dataset.redirectUrl;
const redirectUrl = this.el.dataset.redirectUrl || '/';
if (this.hereBeforeTimerEnds) {
// Wait a bit, if the landing page has the same publish date
setTimeout(() => window.location = redirectUrl, 500);
......
......@@ -29,7 +29,7 @@
<we-checkbox string="Hide countdown at the end" data-dependencies="!no_end_action_opt"
data-select-class="hide-countdown"/>
<we-urlpicker string="URL" data-dependencies="redirect_end_action_opt"
data-select-data-attribute="/my-awesome-page" data-attribute-name="redirectUrl"/>
data-select-data-attribute="" placeholder="e.g. /my-awesome-page" data-attribute-name="redirectUrl"/>
<we-select string="Size" data-attribute-name="size">
<we-button data-select-data-attribute="80">Small</we-button>
<we-button data-select-data-attribute="120">Medium</we-button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment