2015-02-22 06:38:27 +01:00
|
|
|
/*globals wp */
|
|
|
|
|
2015-02-09 01:43:50 +01:00
|
|
|
/**
|
2015-02-22 08:25:27 +01:00
|
|
|
* wp.media.view.Attachment.Details.TwoColumn
|
|
|
|
*
|
2015-02-09 01:43:50 +01:00
|
|
|
* A similar view to media.view.Attachment.Details
|
|
|
|
* for use in the Edit Attachment modal.
|
|
|
|
*
|
2015-02-22 07:28:26 +01:00
|
|
|
* @class
|
2015-02-09 01:43:50 +01:00
|
|
|
* @augments wp.media.view.Attachment.Details
|
|
|
|
* @augments wp.media.view.Attachment
|
|
|
|
* @augments wp.media.View
|
|
|
|
* @augments wp.Backbone.View
|
|
|
|
* @augments Backbone.View
|
|
|
|
*/
|
2015-02-22 09:47:25 +01:00
|
|
|
var Details = wp.media.view.Attachment.Details,
|
2015-02-09 01:43:50 +01:00
|
|
|
TwoColumn;
|
|
|
|
|
|
|
|
TwoColumn = Details.extend({
|
|
|
|
template: wp.template( 'attachment-details-two-column' ),
|
|
|
|
|
|
|
|
editAttachment: function( event ) {
|
|
|
|
event.preventDefault();
|
|
|
|
this.controller.content.mode( 'edit-image' );
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Noop this from parent class, doesn't apply here.
|
|
|
|
*/
|
|
|
|
toggleSelectionHandler: function() {},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
Details.prototype.render.apply( this, arguments );
|
|
|
|
|
|
|
|
wp.media.mixin.removeAllPlayers();
|
|
|
|
this.$( 'audio, video' ).each( function (i, elem) {
|
2015-02-22 06:38:27 +01:00
|
|
|
var el = wp.media.view.MediaDetails.prepareSrc( elem );
|
2015-02-09 17:01:29 +01:00
|
|
|
new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
|
2015-02-09 01:43:50 +01:00
|
|
|
} );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-02-09 17:01:29 +01:00
|
|
|
module.exports = TwoColumn;
|