mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-25 05:50:04 +02:00
6848035d1a
Make sure that the build file for `grid` doesn't load `views/media-details.js`, it already exists in the `audio-video` build. See #29267, #28510. Built from https://develop.svn.wordpress.org/trunk@31487 git-svn-id: http://core.svn.wordpress.org/trunk@31468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
42 lines
913 B
JavaScript
42 lines
913 B
JavaScript
/**
|
|
* wp.media.view.VideoDetails
|
|
*
|
|
* @constructor
|
|
* @augments wp.media.view.MediaDetails
|
|
* @augments wp.media.view.Settings.AttachmentDisplay
|
|
* @augments wp.media.view.Settings
|
|
* @augments wp.media.View
|
|
* @augments wp.Backbone.View
|
|
* @augments Backbone.View
|
|
*/
|
|
var MediaDetails = require( './media-details' ),
|
|
VideoDetails;
|
|
|
|
VideoDetails = MediaDetails.extend({
|
|
className: 'video-details',
|
|
template: wp.template('video-details'),
|
|
|
|
setMedia: function() {
|
|
var video = this.$('.wp-video-shortcode');
|
|
|
|
if ( video.find( 'source' ).length ) {
|
|
if ( video.is(':hidden') ) {
|
|
video.show();
|
|
}
|
|
|
|
if ( ! video.hasClass( 'youtube-video' ) && ! video.hasClass( 'vimeo-video' ) ) {
|
|
this.media = MediaDetails.prepareSrc( video.get(0) );
|
|
} else {
|
|
this.media = video.get(0);
|
|
}
|
|
} else {
|
|
video.hide();
|
|
this.media = false;
|
|
}
|
|
|
|
return this;
|
|
}
|
|
});
|
|
|
|
module.exports = VideoDetails;
|