mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
4d1d632ebd
Toolbars may want to control the target as well as the surface (spoiler alert!). The new TargetToolbar has a pointer to its target as well as its surface. Change-Id: I928316d9e23ac3f3de3e76c34ef0ac3d27855ab3
41 lines
926 B
JavaScript
41 lines
926 B
JavaScript
/*!
|
|
* VisualEditor UserInterface TargetToolbar class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* UserInterface target toolbar.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.SurfaceToolbar
|
|
*
|
|
* @constructor
|
|
* @param {ve.init.Target} target Target to control
|
|
* @param {ve.ui.Surface} surface Surface to control
|
|
* @param {Object} [options] Config options
|
|
*/
|
|
ve.ui.TargetToolbar = function VeUiTargetToolbar( target, surface, options ) {
|
|
// Parent constructor
|
|
ve.ui.SurfaceToolbar.call( this, surface, options );
|
|
|
|
// Properties
|
|
this.target = target;
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.TargetToolbar, ve.ui.SurfaceToolbar );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Gets the target which the toolbar controls.
|
|
*
|
|
* @returns {ve.init.Target} Target being controlled
|
|
*/
|
|
ve.ui.TargetToolbar.prototype.getTarget = function () {
|
|
return this.target;
|
|
};
|