Add overlay and newsletter thumbnail preview

This commit is contained in:
Tautvidas Sipavičius
2015-11-25 16:44:18 +02:00
parent 981cbd579f
commit a516eb1a95
2 changed files with 27 additions and 5 deletions

View File

@@ -150,6 +150,13 @@ define(
this.setState({ loading: false });
}
},
handleShowTemplate: function(template) {
MailPoet.Modal.popup({
title: template.name,
template: '<img src="{{ thumbnail }}" />',
data: template,
});
},
handleTemplateImport: function() {
this.getTemplates();
},
@@ -169,7 +176,10 @@ define(
if (typeof template.thumbnail === 'string'
&& template.thumbnail.length > 0) {
thumbnail = (
<img src={ template.thumbnail } />
<a href="javascript:;" onClick={this.handleShowTemplate.bind(null, template)}>
<img src={ template.thumbnail } />
<div className="mailpoet_overlay"></div>
</a>
);
}