mediawiki-extensions-Visual.../modules/ve/ui/widgets/ve.ui.IconButtonWidget.js
Trevor Parscal efafed3231 Remove ve.{inheritClass,mixinClass} and use OO instead
Change-Id: I8df9226a358a76b661eab6e967ff0d63d361f691
2013-10-18 18:58:08 +02:00

35 lines
856 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 */
OO.inheritClass( ve.ui.IconButtonWidget, ve.ui.ButtonWidget );
OO.mixinClass( ve.ui.IconButtonWidget, ve.ui.IconedElement );