Skip to content

Commit

Permalink
Removing filtering of already selected media in modal
Browse files Browse the repository at this point in the history
This is to prevent a bug that stops the modal from updating when a file
is uploaded.  With this change, already selected media will appear in
the modal, but current code will prevent duplication if selected.  See
#678
  • Loading branch information
funkatron82 committed Nov 11, 2015
1 parent 3953c67 commit 23fe384
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/media.js
Expand Up @@ -171,7 +171,8 @@ jQuery( function ( $ )
events:
{
'click': function(){
var ids = this.collection.pluck( 'id' );
var models = this.collection.models;

// Destroy the previous collection frame.
if ( this._frame )
{
Expand All @@ -183,9 +184,9 @@ jQuery( function ( $ )
className: 'media-frame rwmb-media-frame',
multiple : true,
title : 'Select Media',
editing: true,
library : {
type : this.props.mimeType,
exclude: ids
}
} );

Expand All @@ -197,7 +198,7 @@ jQuery( function ( $ )
this.collection.add( item );
}, this );
} );

this._frame.open();
},
},
Expand Down

0 comments on commit 23fe384

Please sign in to comment.