mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-05 22:22:54 +00:00
91d615e684
Change-Id: I7617a35bd9e8322d0b9f8e225885ccbe5fa230ee
48 lines
1.1 KiB
JavaScript
48 lines
1.1 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] Config 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' )
|
|
.append( this.$label );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.FieldsetLayout, ve.ui.Layout );
|
|
|
|
ve.mixinClass( ve.ui.FieldsetLayout, ve.ui.LabeledElement );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.ui.FieldsetLayout.static.tagName = 'fieldset';
|