Skip video if already seen
[MAILPOET-1447]
This commit is contained in:
@ -18,15 +18,18 @@ const renderBreadcrumb = (newsletterType) => {
|
|||||||
|
|
||||||
function displayTutorial() {
|
function displayTutorial() {
|
||||||
const key = `user_seen_editor_tutorial${window.config.currentUserId}`;
|
const key = `user_seen_editor_tutorial${window.config.currentUserId}`;
|
||||||
|
if (window.config.dragDemoUrlSettings) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
MailPoet.Modal.popup({
|
MailPoet.Modal.popup({
|
||||||
title: MailPoet.I18n.t('tutorialVideoTitle'),
|
title: MailPoet.I18n.t('tutorialVideoTitle'),
|
||||||
template: '<video style="height:640px;" src=' + window.config.dragDemoUrl + ' controls autoplay></video>',
|
template: `<video style="height:640px;" src="${window.config.dragDemoUrl}" controls autoplay></video>`,
|
||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
api_version: window.mailpoet_api_version,
|
api_version: window.mailpoet_api_version,
|
||||||
endpoint: 'settings',
|
endpoint: 'settings',
|
||||||
action: 'set',
|
action: 'set',
|
||||||
data: {[key]: 1},
|
data: { [key]: 1 },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1298,6 +1298,7 @@
|
|||||||
},
|
},
|
||||||
dragDemoUrl: '<%= image_url("newsletter_editor/editor-drag-demo.mp4") %>',
|
dragDemoUrl: '<%= image_url("newsletter_editor/editor-drag-demo.mp4") %>',
|
||||||
currentUserId: '<%= current_wp_user.wp_user_id %>',
|
currentUserId: '<%= current_wp_user.wp_user_id %>',
|
||||||
|
dragDemoUrlSettings: '<%= settings["user_seen_editor_tutorial" ~ current_wp_user.wp_user_id] %>',
|
||||||
};
|
};
|
||||||
wp.hooks.doAction('mailpoet_newsletters_editor_initialize', config);
|
wp.hooks.doAction('mailpoet_newsletters_editor_initialize', config);
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user