Media Grid: "Add New" should open and close, not just open.

See #24716.


git-svn-id: https://develop.svn.wordpress.org/trunk@29087 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-07-11 05:43:26 +00:00
parent ce01c5c760
commit aba2e372e0
2 changed files with 9 additions and 4 deletions

View File

@ -230,7 +230,7 @@
}, },
addNewClickHandler: function() { addNewClickHandler: function() {
this.trigger( 'show:upload:attachment' ); this.trigger( 'toggle:upload:attachment' );
}, },
/** /**

View File

@ -5602,7 +5602,8 @@
AttachmentView: media.view.Attachment.Library AttachmentView: media.view.Attachment.Library
}); });
this.listenTo( this.controller, 'show:upload:attachment', _.bind( this.showUploader, this ) ); this.listenTo( this.controller, 'toggle:upload:attachment', _.bind( this.toggleUploader, this ) );
this.createToolbar(); this.createToolbar();
this.createUploader(); this.createUploader();
this.createAttachments(); this.createAttachments();
@ -5744,8 +5745,12 @@
this.views.add( this.uploader ); this.views.add( this.uploader );
}, },
showUploader: function() { toggleUploader: function() {
if ( this.uploader.$el.hasClass( 'hidden' ) ) {
this.uploader.show(); this.uploader.show();
} else {
this.uploader.hide();
}
}, },
createAttachments: function() { createAttachments: function() {