mediawiki-extensions-Visual.../modules/ve/ui/widgets/ve.ui.IconButtonWidget.js
Trevor Parscal 6ec34a3dee Toolbar action widgetization and UI refactoring
Objectives:

* Use widgets to render toolbar actions
* Remove labels next to help notices and edit notices buttons
* Add a close button to the help notices and edit notices

Overview:

* ve.ui.ButtonWidget is now abstract, use ve.ui.PushButtonWidget instead
* ve.ui.IconButtonWidget now inherits from ve.ui.ButtonWidget
* ve.ui.PopupWidget's display method no longer takes x and y arguments
* Fixup naming issues in MWCategoryPopupWidget
* Fixup naming issues with some ve-init-mw CSS classes
* Rename ve-mw/ui/styles/ve.ui.Widget.css to ve.ui.MWWidget.css
* Change uses of "callout" to "tail"
* Add hyperlink functionality to buttons
* Make buttons accessible through focusing, but make unfocusable by
  clicking
* Add head option to popup for rendering a title and close button

Bug: 52386
Change-Id: Iea2c8df1be64d40f9c039873d89ee540cc56e687
2013-10-04 16:26:13 -07:00

39 lines
928 B
JavaScript

/*!
* VisualEditor UserInterface IconButtonWidget class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Creates an ve.ui.IconButtonWidget object.
*
* @class
* @extends ve.ui.ButtonWidget
* @mixins ve.ui.IconedElement
*
* @constructor
* @param {Object} [config] Configuration options
*/
ve.ui.IconButtonWidget = function VeUiIconButtonWidget( config ) {
// Parent constructor
ve.ui.ButtonWidget.call( this, config );
// Mixin constructors
ve.ui.IconedElement.call( this, this.$$( '<span>' ), config );
// Initialization
this.$button.prepend( this.$icon );
this.$.addClass( 've-ui-iconButtonWidget' );
};
/* Inheritance */
ve.inheritClass( ve.ui.IconButtonWidget, ve.ui.ButtonWidget );
ve.mixinClass( ve.ui.IconButtonWidget, ve.ui.IconedElement );
/* Static Properties */
ve.ui.IconButtonWidget.static.emptyHtml = '';