mediawiki-extensions-Visual.../modules/ve/ui/layouts/ve.ui.FieldsetLayout.js
Trevor Parscal efafed3231 Remove ve.{inheritClass,mixinClass} and use OO instead
Change-Id: I8df9226a358a76b661eab6e967ff0d63d361f691
2013-10-18 18:58:08 +02:00

51 lines
1.2 KiB
JavaScript

/*!
* VisualEditor UserInterface FieldsetLayout class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Fieldset layout.
*
* @class
* @extends ve.ui.Layout
* @mixins ve.ui.LabeledElement
*
* @constructor
* @param {Object} [config] Configuration options
* @cfg {string} [icon] Symbolic icon name
*/
ve.ui.FieldsetLayout = function VeUiFieldsetLayout( config ) {
// Config initialization
config = config || {};
// Parent constructor
ve.ui.Layout.call( this, config );
// Mixin constructors
ve.ui.LabeledElement.call( this, this.$$( '<legend>' ), config );
// Initialization
if ( config.icon ) {
this.$.addClass( 've-ui-fieldsetLayout-decorated' );
this.$label.addClass( 've-ui-icon-' + config.icon );
}
this.$.addClass( 've-ui-fieldsetLayout' );
if ( config.icon || config.label ) {
this.$
.addClass( 've-ui-fieldsetLayout-labeled' )
.append( this.$label );
}
};
/* Inheritance */
OO.inheritClass( ve.ui.FieldsetLayout, ve.ui.Layout );
OO.mixinClass( ve.ui.FieldsetLayout, ve.ui.LabeledElement );
/* Static Properties */
ve.ui.FieldsetLayout.static.tagName = 'fieldset';