mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
09f920fcac
Objective: * Allow fieldsets to not have labels * Remove label from reference edit dialog field set Changes: ve.ui.Layout.css * Only apply negative top margin if fieldset label is being used ve.ui.FieldsetLayout.js * Only add label element to DOM if icon or label are used ve.ui.MWReferenceEditDialog.js * Remove label from reference edit dialog's first fieldset *.php * Remove unused message Change-Id: I4a36e819ec6ef73aad80d3fb2f06000cb35ec109
51 lines
1.2 KiB
JavaScript
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] 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' );
|
|
if ( config.icon || config.label ) {
|
|
this.$
|
|
.addClass( 've-ui-fieldsetLayout-labeled' )
|
|
.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';
|