WordPress/wp-includes/js/media/controllers/image-details.js
Scott Taylor b191013198 Media JS files:
* In media manifests, ditch IIFEs and global injection, these get dynamically scoped via Browserify
* Remove the `debug` option from `browserify:media`
* Add `jshint:media` to `jshint:corejs`
* Add a trailing newline to all new module files

Props iseulde.
See #28510.

Built from https://develop.svn.wordpress.org/trunk@31385


git-svn-id: http://core.svn.wordpress.org/trunk@31366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 16:01:29 +00:00

61 lines
2.1 KiB
JavaScript

/**
* wp.media.controller.ImageDetails
*
* A state for editing the attachment display settings of an image that's been
* inserted into the editor.
*
* @class
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @param {object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=image-details] Unique identifier.
* @param {string} [attributes.title=Image Details] Title for the state. Displays in the frame's title region.
* @param {wp.media.model.Attachment} attributes.image The image's model.
* @param {string|false} [attributes.content=image-details] Initial mode for the content region.
* @param {string|false} [attributes.menu=false] Initial mode for the menu region.
* @param {string|false} [attributes.router=false] Initial mode for the router region.
* @param {string|false} [attributes.toolbar=image-details] Initial mode for the toolbar region.
* @param {boolean} [attributes.editing=false] Unused.
* @param {int} [attributes.priority=60] Unused.
*
* @todo This state inherits some defaults from media.controller.Library.prototype.defaults,
* however this may not do anything.
*/
var State = require( './state.js' ),
Library = require( './library.js' ),
l10n = wp.media.view.l10n,
ImageDetails;
ImageDetails = State.extend({
defaults: _.defaults({
id: 'image-details',
title: l10n.imageDetailsTitle,
content: 'image-details',
menu: false,
router: false,
toolbar: 'image-details',
editing: false,
priority: 60
}, Library.prototype.defaults ),
/**
* @since 3.9.0
*
* @param options Attributes
*/
initialize: function( options ) {
this.image = options.image;
State.prototype.initialize.apply( this, arguments );
},
/**
* @since 3.9.0
*/
activate: function() {
this.frame.modal.$el.addClass('image-details');
}
});
module.exports = ImageDetails;