mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
3e460a02df
Changes: * Remove reference to inspector close method, which didn't actually exist * Use more spacy array syntax for all action methods Change-Id: I08ee2d262acc7b39456766fb4a0b490da88ad041
50 lines
1,001 B
JavaScript
50 lines
1,001 B
JavaScript
/*!
|
|
* VisualEditor UserInterface InspectorAction class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Inspector action.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Action
|
|
* @constructor
|
|
* @param {ve.ui.Surface} surface Surface to act on
|
|
*/
|
|
ve.ui.InspectorAction = function VeUiInspectorAction( surface ) {
|
|
// Parent constructor
|
|
ve.ui.Action.call( this, surface );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.InspectorAction, ve.ui.Action );
|
|
|
|
/* Static Properties */
|
|
|
|
/**
|
|
* List of allowed methods for the action.
|
|
*
|
|
* @static
|
|
* @property
|
|
*/
|
|
ve.ui.InspectorAction.static.methods = [ 'open' ];
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Open an inspector.
|
|
*
|
|
* @method
|
|
* @param {string} name Symbolic name of inspector to open
|
|
*/
|
|
ve.ui.InspectorAction.prototype.open = function ( name ) {
|
|
this.surface.getContext().openInspector( name );
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.actionFactory.register( 'inspector', ve.ui.InspectorAction );
|