From 8c5bcadaa82dbe95984be8d307cd3ca66b846912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Wrede?= Date: Mon, 13 Jan 2020 22:14:02 +0100 Subject: [PATCH] Remove onSelectURL --- packages/block-library/src/media-text/edit.js | 25 ------------------- .../src/media-text/media-container.js | 3 +-- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/packages/block-library/src/media-text/edit.js b/packages/block-library/src/media-text/edit.js index d229a5b300686..e1a7c268ef069 100644 --- a/packages/block-library/src/media-text/edit.js +++ b/packages/block-library/src/media-text/edit.js @@ -57,7 +57,6 @@ class MediaTextEdit extends Component { mediaWidth: null, }; this.onSetHref = this.onSetHref.bind( this ); - this.onSelectURL = this.onSelectURL.bind( this ); } onSelectMedia( media ) { @@ -118,29 +117,6 @@ class MediaTextEdit extends Component { this.props.setAttributes( props ); } - onSelectURL( newURL ) { - const { mediaUrl, linkDestination, href } = this.props.attributes; - - if ( newURL !== mediaUrl ) { - let newHref = href; - if ( linkDestination === LINK_DESTINATION_MEDIA ) { - // Update the media link. - newHref = newURL; - } - - // Check if the image is linked to the attachment page. - if ( linkDestination === LINK_DESTINATION_ATTACHMENT ) { - // Update the media link. - newHref = undefined; - } - this.props.setAttributes( { - mediaUrl: newURL, - href: newHref, - mediaId: undefined, - } ); - } - } - commitWidthChange( width ) { const { setAttributes } = this.props; @@ -159,7 +135,6 @@ class MediaTextEdit extends Component { );