Skip to content

Commit

Permalink
MediaPlaceholder multiple and gallery properties (#9139)
Browse files Browse the repository at this point in the history
* MediaPlaceholder multiple property

The `gallery` property should be set to `true` only after checking that the selected `type` of media is not `audio`.

* gallery and playlist check for multiple and type

gallery and playlist check for multiple and type, being gallery true when multiple is true and type is image, while playlist true when multiple is true and type is audio.

* type check when setting the gallery property

The `gallery` property is set to `true` when `multiple` is `true` and `type === "image"`

* double to single quotes

changed type check using single quotes instead of double quotes
  • Loading branch information
LuigiPulcini authored and youknowriad committed Aug 24, 2018
1 parent efbd9be commit d7eb4f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/components/media-placeholder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class MediaPlaceholder extends Component {
{ __( 'Upload' ) }
</FormFileUpload>
<MediaUpload
gallery={ multiple }
gallery={ multiple && type === 'image' }
multiple={ multiple }
onSelect={ onSelect }
type={ type }
Expand Down

0 comments on commit d7eb4f6

Please sign in to comment.