mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-26 15:21:51 +00:00
d2dfb9ac4f
* Move and rename generic parts of ve.ui to OO.ui * We now have a UI test suite because ve.Element (outside ve.ui) is now part of oojs-ui, so it needs a test suite. * Added to the MW test run (just like we do for unicodejs). * Updated csslint config (also added ve-mw and syntaxhighlight which were missing). oojs-ui still depends on the TriggerRegistry in VE, this is addressed in a follow-up commit. Change-Id: Iec147155c1ddf20b73a4d15d87b8742207032312
51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
/*!
|
|
* ObjectOriented UserInterface FieldsetLayout class.
|
|
*
|
|
* @copyright 2011-2013 OOJS Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Layout made of a fieldset and optional legend.
|
|
*
|
|
* @class
|
|
* @extends OO.ui.Layout
|
|
* @mixins OO.ui.LabeledElement
|
|
*
|
|
* @constructor
|
|
* @param {Object} [config] Configuration options
|
|
* @cfg {string} [icon] Symbolic icon name
|
|
*/
|
|
OO.ui.FieldsetLayout = function OoUiFieldsetLayout( config ) {
|
|
// Config initialization
|
|
config = config || {};
|
|
|
|
// Parent constructor
|
|
OO.ui.Layout.call( this, config );
|
|
|
|
// Mixin constructors
|
|
OO.ui.LabeledElement.call( this, this.$$( '<legend>' ), config );
|
|
|
|
// Initialization
|
|
if ( config.icon ) {
|
|
this.$.addClass( 'oo-ui-fieldsetLayout-decorated' );
|
|
this.$label.addClass( 'oo-ui-icon-' + config.icon );
|
|
}
|
|
this.$.addClass( 'oo-ui-fieldsetLayout' );
|
|
if ( config.icon || config.label ) {
|
|
this.$
|
|
.addClass( 'oo-ui-fieldsetLayout-labeled' )
|
|
.append( this.$label );
|
|
}
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( OO.ui.FieldsetLayout, OO.ui.Layout );
|
|
|
|
OO.mixinClass( OO.ui.FieldsetLayout, OO.ui.LabeledElement );
|
|
|
|
/* Static Properties */
|
|
|
|
OO.ui.FieldsetLayout.static.tagName = 'fieldset';
|