mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
2717ea1645
Objectives: * Use a class for toolbar groups to add more functionality later * Rename addTools method to setup Changes: *.php * Add link to new file * Move ui element classes up for more general use ve.init.mw.ViewPageTarget.js, ve.init.sa.Target.js, ve.ui.Context.js, ve.ui.SurfaceWidget.js * Update use of addTools method ve.ui.Tool.css, ve.ui.Toolbar.css * Move styles between sheets ve.ui.Toolbar.js * Rename addTools to setup * Use ve.ui.ToolGroup objects when building tools ve.ui.ToolGroup.js * New class, encapsulates tools Change-Id: Ic3a643634a80a8ac7d6f6f47f031d001c7efaee7
42 lines
859 B
JavaScript
42 lines
859 B
JavaScript
/*!
|
|
* VisualEditor UserInterface ToolGroup class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* UserInterface tool group.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
* @extends ve.ui.Widget
|
|
* @mixins ve.ui.GroupElement
|
|
*
|
|
* @constructor
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
* @param {Object} [config] Config options
|
|
*/
|
|
ve.ui.ToolGroup = function VeUiToolGroup( toolbar, config ) {
|
|
// Parent constructor
|
|
ve.ui.Widget.call( this, config );
|
|
|
|
// Mixin constructors
|
|
ve.ui.GroupElement.call( this, this.$ );
|
|
|
|
// Properties
|
|
this.toolbar = toolbar;
|
|
|
|
// Events
|
|
this.$.on( { 'mousedown': false } );
|
|
|
|
// Initialization
|
|
this.$.addClass( 've-ui-toolGroup' );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.ToolGroup, ve.ui.Widget );
|
|
|
|
ve.mixinClass( ve.ui.ToolGroup, ve.ui.GroupElement );
|