add image alignment to Posts

This commit is contained in:
Amine Ben hammou
2018-05-23 05:17:51 +00:00
parent d7ab03b1c7
commit 4dd17e47ad
6 changed files with 26 additions and 11 deletions

View File

@@ -59,7 +59,7 @@ define([
},
parse: function (response) {
// If container has any blocks - add them to a collection
if (response.type === 'container' && _.has(response, 'blocks')) {
if (response.type === 'container' && _.has(response, 'blocks') && response.blocks.constructor === Array) {
response.blocks = new BlockCollection(response.blocks, {
parse: true
});

View File

@@ -52,6 +52,7 @@ define([
defaults: function () {
return this._getDefaults({
type: 'posts',
withLayout: true,
amount: '10',
offset: 0,
contentType: 'post', // 'post'|'page'|'mailpoet_page'
@@ -64,7 +65,7 @@ define([
titleAlignment: 'left', // 'left'|'center'|'right'
titleIsLink: false, // false|true
imageFullWidth: false, // true|false
featuredImagePosition: 'belowTitle', // 'aboveTitle'|'belowTitle'|'none'
featuredImagePosition: 'centered', // 'centered'|'right'|'left'|'alternate'|'none'
showAuthor: 'no', // 'no'|'aboveText'|'belowText'
authorPrecededBy: 'Author:',
showCategories: 'no', // 'no'|'aboveText'|'belowText'
@@ -190,7 +191,7 @@ define([
getTemplate: function () { return window.templates.postsBlock; },
modelEvents: {}, // Forcefully disable all events
regions: _.extend({
postsRegion: '.mailpoet_posts_block_posts'
postsRegion: '.mailpoet_posts_container'
}, base.BlockView.prototype.regions),
onDragSubstituteBy: function () { return Module.PostsWidgetView; },
initialize: function () {