Set default for newly added blocks to 'left', for existing blocks to 'none'
[MAILPOET-2491]
This commit is contained in:
committed by
Jack Kitterhing
parent
15b166d188
commit
499c14e0a3
@@ -68,7 +68,7 @@ Module.AutomatedLatestContentLayoutBlockModel = base.BlockModel.extend({
|
|||||||
imageFullWidth: false, // true|false
|
imageFullWidth: false, // true|false
|
||||||
titlePosition: 'abovePost', // 'abovePost'|'aboveExcerpt'
|
titlePosition: 'abovePost', // 'abovePost'|'aboveExcerpt'
|
||||||
featuredImagePosition: 'centered', // 'centered'|'left'|'right'|'alternate'|'none'
|
featuredImagePosition: 'centered', // 'centered'|'left'|'right'|'alternate'|'none'
|
||||||
fullPostFeaturedImagePosition: 'left', // 'centered'|'left'|'right'|'alternate'|'none'
|
fullPostFeaturedImagePosition: 'none', // 'centered'|'left'|'right'|'alternate'|'none'
|
||||||
showAuthor: 'no', // 'no'|'aboveText'|'belowText'
|
showAuthor: 'no', // 'no'|'aboveText'|'belowText'
|
||||||
authorPrecededBy: 'Author:',
|
authorPrecededBy: 'Author:',
|
||||||
showCategories: 'no', // 'no'|'aboveText'|'belowText'
|
showCategories: 'no', // 'no'|'aboveText'|'belowText'
|
||||||
@@ -94,7 +94,12 @@ Module.AutomatedLatestContentLayoutBlockModel = base.BlockModel.extend({
|
|||||||
_container: App.getBlockTypeModel('container'),
|
_container: App.getBlockTypeModel('container'),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
initialize: function () {
|
initialize: function (block) {
|
||||||
|
// when added as new block, set default for full post featured image position to 'left'
|
||||||
|
if (_.isEmpty(block)) {
|
||||||
|
this.set('fullPostFeaturedImagePosition', 'left');
|
||||||
|
}
|
||||||
|
|
||||||
base.BlockView.prototype.initialize.apply(this, arguments);
|
base.BlockView.prototype.initialize.apply(this, arguments);
|
||||||
this.on('change:amount change:contentType change:terms change:inclusionType change:displayType change:titleFormat change:featuredImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:showAuthor change:authorPrecededBy change:showCategories change:categoriesPrecededBy change:readMoreType change:readMoreText change:sortBy change:showDivider change:titlePosition', this._handleChanges, this);
|
this.on('change:amount change:contentType change:terms change:inclusionType change:displayType change:titleFormat change:featuredImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:showAuthor change:authorPrecededBy change:showCategories change:categoriesPrecededBy change:readMoreType change:readMoreText change:sortBy change:showDivider change:titlePosition', this._handleChanges, this);
|
||||||
this.listenTo(this.get('readMoreButton'), 'change', this._handleChanges);
|
this.listenTo(this.get('readMoreButton'), 'change', this._handleChanges);
|
||||||
|
@@ -52,7 +52,7 @@ Module.PostsBlockModel = base.BlockModel.extend({
|
|||||||
imageFullWidth: false, // true|false
|
imageFullWidth: false, // true|false
|
||||||
titlePosition: 'abovePost', // 'abovePost'|'aboveExcerpt'
|
titlePosition: 'abovePost', // 'abovePost'|'aboveExcerpt'
|
||||||
featuredImagePosition: 'centered', // 'centered'|'right'|'left'|'alternate'|'none'
|
featuredImagePosition: 'centered', // 'centered'|'right'|'left'|'alternate'|'none'
|
||||||
fullPostFeaturedImagePosition: 'left', // 'centered'|'left'|'right'|'alternate'|'none'
|
fullPostFeaturedImagePosition: 'none', // 'centered'|'left'|'right'|'alternate'|'none'
|
||||||
showAuthor: 'no', // 'no'|'aboveText'|'belowText'
|
showAuthor: 'no', // 'no'|'aboveText'|'belowText'
|
||||||
authorPrecededBy: 'Author:',
|
authorPrecededBy: 'Author:',
|
||||||
showCategories: 'no', // 'no'|'aboveText'|'belowText'
|
showCategories: 'no', // 'no'|'aboveText'|'belowText'
|
||||||
@@ -81,7 +81,7 @@ Module.PostsBlockModel = base.BlockModel.extend({
|
|||||||
_transformedPosts: App.getBlockTypeModel('container'),
|
_transformedPosts: App.getBlockTypeModel('container'),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
initialize: function () {
|
initialize: function (block) {
|
||||||
var POST_REFRESH_DELAY_MS = 500;
|
var POST_REFRESH_DELAY_MS = 500;
|
||||||
var refreshAvailablePosts = _.debounce(
|
var refreshAvailablePosts = _.debounce(
|
||||||
this.fetchAvailablePosts.bind(this),
|
this.fetchAvailablePosts.bind(this),
|
||||||
@@ -92,6 +92,11 @@ Module.PostsBlockModel = base.BlockModel.extend({
|
|||||||
POST_REFRESH_DELAY_MS
|
POST_REFRESH_DELAY_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// when added as new block, set default for full post featured image position to 'left'
|
||||||
|
if (_.isEmpty(block)) {
|
||||||
|
this.set('fullPostFeaturedImagePosition', 'left');
|
||||||
|
}
|
||||||
|
|
||||||
// Attach Radio.Requests API primarily for highlighting
|
// Attach Radio.Requests API primarily for highlighting
|
||||||
_.extend(this, Radio.Requests);
|
_.extend(this, Radio.Requests);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user