/*!
- * OOUI v0.25.3
+ * OOUI v0.26.1
* https://www.mediawiki.org/wiki/OOUI
*
* Copyright 2011–2018 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2018-03-07T06:52:35Z
+ * Date: 2018-03-23T23:42:32Z
*/
( function ( OO ) {
*/
OO.ui.WikimediaUITheme.prototype.getElementClasses = function ( element ) {
// Parent method
- var variant, isFramed, isActive,
+ var variant, isFramed, isActive, isToolOrGroup,
variants = {
warning: false,
invert: false,
if ( element.supports( [ 'hasFlag' ] ) ) {
isFramed = element.supports( [ 'isFramed' ] ) && element.isFramed();
isActive = element.supports( [ 'isActive' ] ) && element.isActive();
+ isToolOrGroup =
+ ( OO.ui.Tool && element instanceof OO.ui.Tool ) ||
+ ( OO.ui.ToolGroup && element instanceof OO.ui.ToolGroup );
if (
// Button with a dark background
isFramed && ( isActive || element.isDisabled() || element.hasFlag( 'primary' ) ) ||
// Toolbar with a dark background
- OO.ui.ToolGroup && element instanceof OO.ui.ToolGroup && ( isActive || element.hasFlag( 'primary' ) )
+ isToolOrGroup && element.hasFlag( 'primary' )
) {
// … use white icon / indicator, regardless of other flags
variants.invert = true;
variants.invert = false;
} else if ( !element.isDisabled() ) {
// Any other kind of button, use the right colored icon / indicator if available
- variants.progressive = element.hasFlag( 'progressive' );
+ variants.progressive = element.hasFlag( 'progressive' ) ||
+ // Active tools/toolgroups
+ ( isToolOrGroup && isActive ) ||
+ // Pressed or selected outline option widgets
+ (
+ OO.ui.OutlineOptionWidget && element instanceof OO.ui.OutlineOptionWidget &&
+ ( element.isPressed() || element.isSelected() )
+ );
+
variants.destructive = element.hasFlag( 'destructive' );
variants.warning = element.hasFlag( 'warning' );
}