jenkins-bot has submitted this change and it was merged.

Change subject: ToggleButtonWidget: Add description, example, and mark private 
method
......................................................................


ToggleButtonWidget: Add description, example, and mark private method

Change-Id: Ic7beb8724cb4c2666db6257019f58d80f819f223
---
M src/widgets/ToggleButtonWidget.js
1 file changed, 24 insertions(+), 2 deletions(-)

Approvals:
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/widgets/ToggleButtonWidget.js 
b/src/widgets/ToggleButtonWidget.js
index 154d126..0500f2a 100644
--- a/src/widgets/ToggleButtonWidget.js
+++ b/src/widgets/ToggleButtonWidget.js
@@ -1,5 +1,24 @@
 /**
- * Button that toggles on and off.
+ * ToggleButtons are buttons that have a state (‘on’ or ‘off’) that is 
represented by a
+ * Boolean value. Like other {@link OO.ui.ButtonWidget buttons}, toggle 
buttons can be
+ * configured with {@link OO.ui.IconElement icons}, {@link 
OO.ui.IndicatorElement indicators},
+ * {@link OO.ui.TitledElement titles}, {@link OO.ui.FlaggedElement styling 
flags},
+ * and {@link OO.ui.LabelElement labels}. Please see
+ * the [OOjs UI documentation][1] on MediaWiki for more information.
+ *
+ *     @example
+ *     // Toggle buttons in the 'off' and 'on' state.
+ *     var toggleButton1 = new OO.ui.ToggleButtonWidget( {
+ *         label: 'Toggle Button off'
+ *     } );
+ *     var toggleButton2 = new OO.ui.ToggleButtonWidget( {
+ *         label: 'Toggle Button on',
+ *         value: true
+ *     } );
+ *     // Append the buttons to the DOM.
+ *     $( 'body' ).append( toggleButton1.$element, toggleButton2.$element );
+ *
+ * [1]: 
https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Buttons_and_Switches#Toggle_buttons
  *
  * @class
  * @extends OO.ui.ButtonWidget
@@ -7,7 +26,8 @@
  *
  * @constructor
  * @param {Object} [config] Configuration options
- * @cfg {boolean} [value=false] Initial value
+ * @cfg {boolean} [value=false] The toggle button’s initial on/off
+ *  state. By default, the button is in the 'off' state.
  */
 OO.ui.ToggleButtonWidget = function OoUiToggleButtonWidget( config ) {
        // Configuration initialization
@@ -34,6 +54,8 @@
 /* Methods */
 
 /**
+ *
+ * @private
  * Handle the button action being triggered.
  */
 OO.ui.ToggleButtonWidget.prototype.onAction = function () {

-- 
To view, visit https://gerrit.wikimedia.org/r/193508
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7beb8724cb4c2666db6257019f58d80f819f223
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Kmenger <[email protected]>
Gerrit-Reviewer: Kmenger <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to