Skip to content

Commit

Permalink
Use full size images on existing slideshow blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtr committed Oct 10, 2019
1 parent 2f0aa28 commit 41d406c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions extensions/blocks/slideshow/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class SlideshowEdit extends Component {
selectedImage: null,
};
}
componentDidMount() {
const { ids, sizeSlug } = this.props.attributes;
if ( ! sizeSlug ) {
this.setAttributes( { sizeSlug: ids.length ? 'full' : 'large' } );
}
}
setAttributes( attributes ) {
if ( attributes.ids ) {
throw new Error(
Expand Down
1 change: 0 additions & 1 deletion extensions/blocks/slideshow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const attributes = {
},
sizeSlug: {
type: 'string',
default: 'large',
},
};

Expand Down

0 comments on commit 41d406c

Please sign in to comment.