mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 10:59:56 +00:00
6ec34a3dee
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
39 lines
928 B
JavaScript
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 = '';
|