mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
43 lines
913 B
JavaScript
43 lines
913 B
JavaScript
|
/*!
|
||
|
* VisualEditor Standalone Initialization Target class.
|
||
|
*
|
||
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
||
|
* @license The MIT License (MIT); see LICENSE.txt
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Initialization Standalone target.
|
||
|
*
|
||
|
* @class
|
||
|
* @extends ve.init.Target
|
||
|
*
|
||
|
* @constructor
|
||
|
* @param {jQuery} $container Container to render target into
|
||
|
*/
|
||
|
ve.init.sa.Target = function VeInitSaTarget( $container ) {
|
||
|
// Parent constructor
|
||
|
ve.init.Target.call( this, $container );
|
||
|
|
||
|
// Events
|
||
|
this.addListenerMethods( this, { 'addDialog': 'onAddDialog' } );
|
||
|
};
|
||
|
|
||
|
/* Inheritance */
|
||
|
|
||
|
ve.inheritClass( ve.init.sa.Target, ve.init.Target );
|
||
|
|
||
|
/* Methods */
|
||
|
|
||
|
/**
|
||
|
* Handle add dialog events.
|
||
|
*
|
||
|
* @method
|
||
|
* @param {string} name Name of added dialog
|
||
|
*/
|
||
|
ve.init.sa.Target.prototype.onAddDialog = function ( name ) {
|
||
|
var dialog = this.dialogs[name];
|
||
|
|
||
|
// Append dialog to target container
|
||
|
this.$.append( dialog.$ );
|
||
|
};
|