2015-02-22 08:25:27 +01:00
|
|
|
/*globals wp */
|
|
|
|
|
2015-02-09 01:43:50 +01:00
|
|
|
/**
|
|
|
|
* wp.media.view.EmbedImage
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @augments wp.media.view.Settings.AttachmentDisplay
|
|
|
|
* @augments wp.media.view.Settings
|
|
|
|
* @augments wp.media.View
|
|
|
|
* @augments wp.Backbone.View
|
|
|
|
* @augments Backbone.View
|
|
|
|
*/
|
|
|
|
var AttachmentDisplay = require( '../settings/attachment-display.js' ),
|
|
|
|
EmbedImage;
|
|
|
|
|
|
|
|
EmbedImage = AttachmentDisplay.extend({
|
|
|
|
className: 'embed-media-settings',
|
|
|
|
template: wp.template('embed-image-settings'),
|
|
|
|
|
|
|
|
initialize: function() {
|
|
|
|
/**
|
|
|
|
* Call `initialize` directly on parent class with passed arguments
|
|
|
|
*/
|
|
|
|
AttachmentDisplay.prototype.initialize.apply( this, arguments );
|
|
|
|
this.listenTo( this.model, 'change:url', this.updateImage );
|
|
|
|
},
|
|
|
|
|
|
|
|
updateImage: function() {
|
|
|
|
this.$('img').attr( 'src', this.model.get('url') );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-02-09 17:01:29 +01:00
|
|
|
module.exports = EmbedImage;
|