diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /vendor/oojs/oojs-ui/src/widgets/GroupWidget.js | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'vendor/oojs/oojs-ui/src/widgets/GroupWidget.js')
-rw-r--r-- | vendor/oojs/oojs-ui/src/widgets/GroupWidget.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/oojs/oojs-ui/src/widgets/GroupWidget.js b/vendor/oojs/oojs-ui/src/widgets/GroupWidget.js new file mode 100644 index 00000000..7d9be905 --- /dev/null +++ b/vendor/oojs/oojs-ui/src/widgets/GroupWidget.js @@ -0,0 +1,48 @@ +/** + * Mixin for OO.ui.Widget subclasses to provide OO.ui.GroupElement. + * + * Use together with OO.ui.ItemWidget to make disabled state inheritable. + * + * @private + * @abstract + * @class + * @extends OO.ui.GroupElement + * + * @constructor + * @param {Object} [config] Configuration options + */ +OO.ui.GroupWidget = function OoUiGroupWidget( config ) { + // Parent constructor + OO.ui.GroupWidget.super.call( this, config ); +}; + +/* Setup */ + +OO.inheritClass( OO.ui.GroupWidget, OO.ui.GroupElement ); + +/* Methods */ + +/** + * Set the disabled state of the widget. + * + * This will also update the disabled state of child widgets. + * + * @param {boolean} disabled Disable widget + * @chainable + */ +OO.ui.GroupWidget.prototype.setDisabled = function ( disabled ) { + var i, len; + + // Parent method + // Note: Calling #setDisabled this way assumes this is mixed into an OO.ui.Widget + OO.ui.Widget.prototype.setDisabled.call( this, disabled ); + + // During construction, #setDisabled is called before the OO.ui.GroupElement constructor + if ( this.items ) { + for ( i = 0, len = this.items.length; i < len; i++ ) { + this.items[ i ].updateDisabled(); + } + } + + return this; +}; |