Skip video if already seen
[MAILPOET-1447]
This commit is contained in:
@ -18,15 +18,18 @@ const renderBreadcrumb = (newsletterType) => {
|
||||
|
||||
function displayTutorial() {
|
||||
const key = `user_seen_editor_tutorial${window.config.currentUserId}`;
|
||||
if (window.config.dragDemoUrlSettings) {
|
||||
return;
|
||||
}
|
||||
MailPoet.Modal.popup({
|
||||
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: () => {
|
||||
MailPoet.Ajax.post({
|
||||
api_version: window.mailpoet_api_version,
|
||||
endpoint: 'settings',
|
||||
action: 'set',
|
||||
data: {[key]: 1},
|
||||
data: { [key]: 1 },
|
||||
});
|
||||
},
|
||||
});
|
||||
|
@ -1298,6 +1298,7 @@
|
||||
},
|
||||
dragDemoUrl: '<%= image_url("newsletter_editor/editor-drag-demo.mp4") %>',
|
||||
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);
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user