Skip to content
This repository has been archived by the owner on Aug 24, 2018. It is now read-only.

Commit

Permalink
Handle error message library link with media modal
Browse files Browse the repository at this point in the history
See
#27 (review)
7656114
  • Loading branch information
obenland committed Mar 17, 2017
1 parent a5848c3 commit 43e5c93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wp-admin/js/widgets/media-image-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@
*
* @returns {void}
*/
selectMedia: function selectMedia() {
selectMedia: function selectMedia( event ) {
var control = this, selection, mediaFrame;

event.preventDefault();

selection = new wp.media.model.Selection( [ control.selectedAttachment ] );

mediaFrame = wp.media( {
Expand Down
1 change: 1 addition & 0 deletions wp-admin/js/widgets/media-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ wp.mediaWidgets = ( function( $ ) {
* @type {Object}
*/
events: {
'click .notice a': 'selectMedia',
'click .select-media': 'selectMedia',
'click .edit-media': 'editMedia'
},
Expand Down

0 comments on commit 43e5c93

Please sign in to comment.