/*!
- * OOjs UI v0.1.0-pre (70932872ba)
+ * OOjs UI v0.1.0-pre (ac6848398c)
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2014 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: Tue Apr 08 2014 12:42:30 GMT-0700 (PDT)
+ * Date: Wed Apr 09 2014 17:58:17 GMT-0700 (PDT)
*/
( function ( OO ) {
this.$element.append( win.$element );
};
/**
+ * Modal dialog window.
+ *
* @abstract
* @class
* @extends OO.ui.Window
return this;
};
/**
- * Element with named flags, used for styling, that can be added, removed and listed and checked.
+ * Element with named flags that can be added, removed, listed and checked.
+ *
+ * A flag, when set, adds a CSS class on the `$element` by combing `oo-ui-flaggableElement-` with
+ * the flag name. Flags are primarily useful for styling.
*
* @class
* @abstract
this.$element.remove();
};
/**
- * Factory for tools.
+ * Factory for tool groups.
*
* @class
* @extends OO.Factory
if ( this.field instanceof OO.ui.InputWidget ) {
this.$label.on( 'click', OO.ui.bind( this.onLabelClick, this ) );
}
+ this.field.connect( this, { 'disable': 'onFieldDisable' } );
// Initialization
this.$element.addClass( 'oo-ui-fieldLayout' );
this.$field
.addClass( 'oo-ui-fieldLayout-field' )
+ .toggleClass( 'oo-ui-fieldLayout-disable', this.field.isDisabled() )
.append( this.field.$element );
this.setAlignment( config.align );
};
/* Methods */
/**
- * Handles label mouse click events.
+ * Handle field disable events.
+ *
+ * @param {boolean} value Field is disabled
+ */
+OO.ui.FieldLayout.prototype.onFieldDisable = function ( value ) {
+ this.$element.toggleClass( 'oo-ui-fieldLayout-disabled', value );
+};
+
+/**
+ * Handle label mouse click events.
*
* @method
* @param {jQuery.Event} e Mouse click event
OO.inheritClass( OO.ui.PanelLayout, OO.ui.Layout );
/**
- * Page within an OO.ui.BookletLayout.
+ * Page within an booklet layout.
*
* @class
* @extends OO.ui.PanelLayout
this.setLabel( labelTexts.join( ', ' ) || ' ' );
};
/**
- * UserInterface popup tool.
+ * Tool that shows a popup when selected.
*
* @abstract
* @class
return this;
};
/**
- * Creates an OO.ui.IconWidget object.
+ * Icon widget.
*
* @class
* @extends OO.ui.Widget
OO.ui.IconWidget.static.tagName = 'span';
/**
- * Creates an OO.ui.IndicatorWidget object.
+ * Indicator widget.
*
* @class
* @extends OO.ui.Widget
/**
* Container for multiple related buttons.
*
+ * Use together with OO.ui.ButtonWidget.
+ *
* @class
* @extends OO.ui.Widget
* @mixins OO.ui.GroupElement
OO.inheritClass( OO.ui.ButtonGroupWidget, OO.ui.Widget );
OO.mixinClass( OO.ui.ButtonGroupWidget, OO.ui.GroupElement );
/**
- * Creates an OO.ui.ButtonWidget object.
+ * Button widget.
*
* @class
* @abstract
return false;
};
/**
- * Creates an OO.ui.InputWidget object.
+ * Input widget.
*
* @class
* @abstract
return this;
};
/**
- * Creates an OO.ui.CheckboxInputWidget object.
+ * Checkbox widget.
*
* @class
* @extends OO.ui.InputWidget
}
};
/**
- * Creates an OO.ui.LabelWidget object.
+ * Label widget.
*
* @class
* @extends OO.ui.Widget
return [];
};
/**
- * Creates an OO.ui.OptionWidget object.
+ * Option widget.
+ *
+ * Use with OO.ui.SelectWidget.
*
* @class
* @abstract
return this.data;
};
/**
- * Create an OO.ui.SelectWidget object.
+ * Selection of options.
+ *
+ * Use together with OO.ui.OptionWidget.
*
* @class
* @abstract
return this;
};
/**
- * Creates an OO.ui.MenuItemWidget object.
+ * Menu item widget.
+ *
+ * Use with OO.ui.MenuWidget.
*
* @class
* @extends OO.ui.OptionWidget
OO.inheritClass( OO.ui.MenuItemWidget, OO.ui.OptionWidget );
/**
- * Create an OO.ui.MenuWidget object.
+ * Menu widget.
+ *
+ * Use together with OO.ui.MenuItemWidget.
*
* @class
* @extends OO.ui.SelectWidget
/**
* Inline menu of options.
*
+ * Use with OO.ui.MenuOptionWidget.
+ *
* @class
* @extends OO.ui.Widget
* @mixins OO.ui.IconedElement
return false;
};
/**
- * Creates an OO.ui.MenuSectionItemWidget object.
+ * Menu section item widget.
+ *
+ * Use with OO.ui.MenuWidget.
*
* @class
* @extends OO.ui.OptionWidget
/**
* Create an OO.ui.OutlineWidget object.
*
+ * Use with OO.ui.OutlineItemWidget.
+ *
* @class
* @extends OO.ui.SelectWidget
*
/**
* Creates an OO.ui.OutlineControlsWidget object.
*
+ * Use together with OO.ui.OutlineWidget.js
+ *
* @class
*
* @constructor
/**
* Creates an OO.ui.OutlineItemWidget object.
*
+ * Use with OO.ui.OutlineWidget.
+ *
* @class
* @extends OO.ui.OptionWidget
*
return this;
};
/**
- * Create an OO.ui.ButtonOptionWidget object.
+ * Option widget that looks like a button.
+ *
+ * Use together with OO.ui.ButtonSelectWidget.
*
* @class
* @extends OO.ui.OptionWidget
return this;
};
/**
- * Create an OO.ui.ButtonSelect object.
+ * Select widget containing button options.
+ *
+ * Use together with OO.ui.ButtonOptionWidget.
*
* @class
* @extends OO.ui.SelectWidget
OO.inheritClass( OO.ui.ButtonSelectWidget, OO.ui.SelectWidget );
/**
- * Creates an OO.ui.PopupWidget object.
+ * Container for content that is overlaid and positioned absolutely.
*
* @class
* @extends OO.ui.Widget
return false;
};
/**
- * Creates an OO.ui.SearchWidget object.
+ * Search widget.
+ *
+ * Combines query and results selection widgets.
*
* @class
* @extends OO.ui.Widget
return this.results;
};
/**
- * Creates an OO.ui.TextInputWidget object.
+ * Text input widget.
*
* @class
* @extends OO.ui.InputWidget
return this;
};
/**
- * Creates an OO.ui.TextInputMenuWidget object.
+ * Menu for a text input widget.
*
* @class
* @extends OO.ui.MenuWidget
return this;
};
/**
+ * Width with on and off states.
+ *
* Mixin for widgets with a boolean state.
*
* @class
return this;
};
/**
+ * Button that toggles on and off.
+ *
* @class
* @extends OO.ui.ButtonWidget
* @mixins OO.ui.ToggleWidget
return this;
};
/**
+ * Switch that slides on and off.
+ *
* @class
* @abstract
* @extends OO.ui.Widget