diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /vendor/oojs/oojs-ui/src/toolgroups/MenuToolGroup.js | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'vendor/oojs/oojs-ui/src/toolgroups/MenuToolGroup.js')
-rw-r--r-- | vendor/oojs/oojs-ui/src/toolgroups/MenuToolGroup.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/vendor/oojs/oojs-ui/src/toolgroups/MenuToolGroup.js b/vendor/oojs/oojs-ui/src/toolgroups/MenuToolGroup.js deleted file mode 100644 index aef69a93..00000000 --- a/vendor/oojs/oojs-ui/src/toolgroups/MenuToolGroup.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Drop down menu layout of tools as selectable menu items. - * - * @class - * @extends OO.ui.PopupToolGroup - * - * @constructor - * @param {OO.ui.Toolbar} toolbar - * @param {Object} [config] Configuration options - */ -OO.ui.MenuToolGroup = function OoUiMenuToolGroup( toolbar, config ) { - // Allow passing positional parameters inside the config object - if ( OO.isPlainObject( toolbar ) && config === undefined ) { - config = toolbar; - toolbar = config.toolbar; - } - - // Configuration initialization - config = config || {}; - - // Parent constructor - OO.ui.MenuToolGroup.super.call( this, toolbar, config ); - - // Events - this.toolbar.connect( this, { updateState: 'onUpdateState' } ); - - // Initialization - this.$element.addClass( 'oo-ui-menuToolGroup' ); -}; - -/* Setup */ - -OO.inheritClass( OO.ui.MenuToolGroup, OO.ui.PopupToolGroup ); - -/* Static Properties */ - -OO.ui.MenuToolGroup.static.name = 'menu'; - -/* Methods */ - -/** - * Handle the toolbar state being updated. - * - * When the state changes, the title of each active item in the menu will be joined together and - * used as a label for the group. The label will be empty if none of the items are active. - */ -OO.ui.MenuToolGroup.prototype.onUpdateState = function () { - var name, - labelTexts = []; - - for ( name in this.tools ) { - if ( this.tools[ name ].isActive() ) { - labelTexts.push( this.tools[ name ].getTitle() ); - } - } - - this.setLabel( labelTexts.join( ', ' ) || ' ' ); -}; |