/*!
- * OOUI v0.25.3
+ * OOUI v0.26.4
* 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-04-17T22:23:58Z
*/
( function ( OO ) {
this.$accel = $( '<span>' );
this.$link = $( '<a>' );
this.title = null;
+ this.checkIcon = new OO.ui.IconWidget( {
+ icon: 'check',
+ classes: [ 'oo-ui-tool-checkIcon' ]
+ } );
// Mixin constructors
OO.ui.mixin.IconElement.call( this, config );
} );
this.$link
.addClass( 'oo-ui-tool-link' )
- .append( this.$icon, this.$title, this.$accel )
+ .append( this.checkIcon.$element, this.$icon, this.$title, this.$accel )
.attr( 'role', 'button' );
this.$element
.data( 'oo-ui-tool', this )
*/
OO.ui.Tool.prototype.setActive = function ( state ) {
this.active = !!state;
- if ( this.active ) {
- this.$element.addClass( 'oo-ui-tool-active' );
- this.setFlags( { progressive: true } );
- } else {
- this.$element.removeClass( 'oo-ui-tool-active' );
- this.setFlags( { progressive: false } );
- }
+ this.$element.toggleClass( 'oo-ui-tool-active', this.active );
+ this.updateThemeClasses();
};
/**
}
};
+/**
+ * Check if the tool group is active.
+ *
+ * @return {boolean} Tool group is active
+ */
+OO.ui.PopupToolGroup.prototype.isActive = function () {
+ return this.active;
+};
+
/**
* Switch into 'active' mode.
*
this.$clippable.css( 'left', '' );
// Try anchoring the popup to the left first
this.$element.addClass( 'oo-ui-popupToolGroup-active oo-ui-popupToolGroup-left' );
- this.setFlags( { progressive: true } );
this.toggleClipping( true );
if ( this.isClippedHorizontally() ) {
// Anchoring to the left caused the popup to clip, so anchor it to the right instead
this.getElementDocument().removeEventListener( 'mouseup', this.onBlurHandler, true );
this.getElementDocument().removeEventListener( 'keyup', this.onBlurHandler, true );
this.$element.removeClass(
- 'oo-ui-popupToolGroup-active oo-ui-popupToolGroup-left oo-ui-popupToolGroup-right'
+ 'oo-ui-popupToolGroup-active oo-ui-popupToolGroup-left oo-ui-popupToolGroup-right'
);
- this.setFlags( { progressive: false } );
this.toggleClipping( false );
}
+ this.updateThemeClasses();
}
};