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

@@ -19,16 +19,28 @@
margin-right: 15px
float: left
overflow: hidden
position: relative
img
min-width: 150px
min-height: 150px
height: 100%
width: auto
height: auto
width: 110%
position: relative
top: 50%
top: 0
left: 50%
transform: translate(-50%, -50%)
transform: translate(-50%, 0%)
.mailpoet_overlay
position: absolute
top: 0
left: 0
right: 0
bottom: 0
background-color: rgba(255, 255, 255, 0.0)
&:hover
background-color: rgba(255, 255, 255, 0.7)
.mailpoet_boxes .mailpoet_description
float:left

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 = (
<a href="javascript:;" onClick={this.handleShowTemplate.bind(null, template)}>
<img src={ template.thumbnail } />
<div className="mailpoet_overlay"></div>
</a>
);
}