mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-18 11:46:01 +00:00
4aa86d0f87
Objective: * Remove surface dependencies in dialogs, inspectors, windows and window sets * Introduce surface-specific versions of dialogs, inspectors and window sets Change-Id: I2db59127d2085b02e173a3605e174317e419e213
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface SurfaceWindowSet class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* UserInterface surface window set.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.WindowSet
|
|
*
|
|
* @constructor
|
|
* @param {ve.ui.Surface} surface
|
|
* @param {ve.Factory} factory Window factory
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.SurfaceWindowSet = function VeUiSurfaceWindowSet( surface, factory, config ) {
|
|
// Parent constructor
|
|
ve.ui.WindowSet.call( this, factory, config );
|
|
|
|
// Properties
|
|
this.surface = surface;
|
|
|
|
// Initialization
|
|
this.$.addClass( 've-ui-surfaceWindowSet' );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.SurfaceWindowSet, ve.ui.WindowSet );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
ve.ui.SurfaceWindowSet.prototype.onWindowClose = function ( win, accept ) {
|
|
this.surface.getView().focus();
|
|
ve.ui.WindowSet.prototype.onWindowClose.call( this, win, accept );
|
|
};
|
|
|
|
/**
|
|
* Get the surface.
|
|
*
|
|
* @method
|
|
* @returns {ve.ui.Surface} Surface
|
|
*/
|
|
ve.ui.SurfaceWindowSet.prototype.getSurface = function () {
|
|
return this.surface;
|
|
};
|