Kmenger has uploaded a new change for review. https://gerrit.wikimedia.org/r/198275
Change subject: FieldsetLayout: Add description and example ...................................................................... FieldsetLayout: Add description and example Change-Id: Ic9a27a7ecff87d84dc9479b7a21f5ad7c3e2aa9f --- M src/layouts/FieldsetLayout.js 1 file changed, 30 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/75/198275/1 diff --git a/src/layouts/FieldsetLayout.js b/src/layouts/FieldsetLayout.js index a3b14f4..1a21e8e 100644 --- a/src/layouts/FieldsetLayout.js +++ b/src/layouts/FieldsetLayout.js @@ -1,7 +1,34 @@ /** - * Layout made of a fieldset and optional legend. + * FieldsetLayouts are composed of one or more {@link OO.ui.FieldLayout FieldLayouts}, + * which each contain an individual widget and, optionally, a label. Each Fieldset can be + * configured with a label as well. For more information and examples, + * please see the [OOjs UI documentation on MediaWiki][1]. * - * Just add OO.ui.FieldLayout items. + * @example + * // Example of a fieldset layout + * var input1 = new OO.ui.TextInputWidget( { + * placeholder: 'A text input field' + * } ); + * + * var input2 = new OO.ui.TextInputWidget( { + * placeholder: 'A text input field' + * } ); + * + * var fieldset = new OO.ui.FieldsetLayout( { + * label: 'Example of a fieldset layout' + * } ); + * + * fieldset.addItems( [ + * new OO.ui.FieldLayout( input1, { + * label: 'Field One' + * } ), + * new OO.ui.FieldLayout( input2, { + * label: 'Field Two' + * } ) + * ] ); + * $( 'body' ).append( fieldset.$element ); + * + * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Layouts/Fields_and_Fieldsets * * @class * @extends OO.ui.Layout @@ -11,7 +38,7 @@ * * @constructor * @param {Object} [config] Configuration options - * @cfg {OO.ui.FieldLayout[]} [items] Items to add + * @cfg {OO.ui.FieldLayout[]} [items] An array of fields to add to the fieldset. See OO.ui.FieldLayout for more information about fields. */ OO.ui.FieldsetLayout = function OoUiFieldsetLayout( config ) { // Configuration initialization -- To view, visit https://gerrit.wikimedia.org/r/198275 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9a27a7ecff87d84dc9479b7a21f5ad7c3e2aa9f Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Kmenger <kmen...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits