CoreFiles by mySites.guru
button-group.js46 lines, 913 bytes, from wordpress-4.2-beta4.zip
Raw History Compare with 4.2-beta3
md5
3a21f684dcbcfe0d204cf1fe2922674a
sha1
d69a045e6c541d07436ed6cd526dc83f3d45bd85
sha256
64f66b6af0fd35ac12cd419e53aaec198eb35b5bcfcb5dd8f235e5914360c95f
/*globals _, Backbone */

/**
 * wp.media.view.ButtonGroup
 *
 * @class
 * @augments wp.media.View
 * @augments wp.Backbone.View
 * @augments Backbone.View
 */
var $ = Backbone.$,
	ButtonGroup;

ButtonGroup = wp.media.View.extend({
	tagName:   'div',
	className: 'button-group button-large media-button-group',

	initialize: function() {
		/**
		 * @member {wp.media.view.Button[]}
		 */
		this.buttons = _.map( this.options.buttons || [], function( button ) {
			if ( button instanceof Backbone.View ) {
				return button;
			} else {
				return new wp.media.view.Button( button ).render();
			}
		});

		delete this.options.buttons;

		if ( this.options.classes ) {
			this.$el.addClass( this.options.classes );
		}
	},

	/**
	 * @returns {wp.media.view.ButtonGroup}
	 */
	render: function() {
		this.$el.html( $( _.pluck( this.buttons, 'el' ) ).detach() );
		return this;
	}
});

module.exports = ButtonGroup;

No other release has this exact content. See every version of this file.