From 7bfe862cb407968f94abb64b8e78eef899b8814f Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 7 Jul 2017 17:06:33 +0200 Subject: [PATCH] Remove MediaUploadButton autoOpen prop --- blocks/library/cover-image/index.js | 1 - blocks/library/gallery/index.js | 1 - blocks/library/image/index.js | 1 - blocks/media-upload-button/index.js | 6 ------ 4 files changed, 9 deletions(-) diff --git a/blocks/library/cover-image/index.js b/blocks/library/cover-image/index.js index 7a632ddd1384e..18f185b5649b6 100644 --- a/blocks/library/cover-image/index.js +++ b/blocks/library/cover-image/index.js @@ -88,7 +88,6 @@ registerBlockType( 'core/cover-image', { buttonProps={ uploadButtonProps } onSelect={ onSelectImage } type="image" - autoOpen > { __( 'Insert from Media Library' ) } diff --git a/blocks/library/gallery/index.js b/blocks/library/gallery/index.js index 3cd6c3b41af19..cfc9d107e29ba 100644 --- a/blocks/library/gallery/index.js +++ b/blocks/library/gallery/index.js @@ -119,7 +119,6 @@ registerBlockType( 'core/gallery', { buttonProps={ uploadButtonProps } onSelect={ setMediaUrl } type="image" - autoOpen multiple="true" > { __( 'Insert from Media Library' ) } diff --git a/blocks/library/image/index.js b/blocks/library/image/index.js index 53e14f66e3982..133a7b377e33d 100644 --- a/blocks/library/image/index.js +++ b/blocks/library/image/index.js @@ -110,7 +110,6 @@ registerBlockType( 'core/image', { buttonProps={ uploadButtonProps } onSelect={ onSelectImage } type="image" - autoOpen > { __( 'Insert from Media Library' ) } diff --git a/blocks/media-upload-button/index.js b/blocks/media-upload-button/index.js index 81cd6f5445265..013c15707ced4 100644 --- a/blocks/media-upload-button/index.js +++ b/blocks/media-upload-button/index.js @@ -28,12 +28,6 @@ class MediaUploadButton extends Component { this.frame.on( 'open', this.onOpen ); } - componentDidMount() { - if ( !! this.props.autoOpen ) { - setTimeout( () => this.frame.open() ); - } - } - componentWillUnmount() { this.frame.remove(); }