2013-10-04 17:51:44 +00:00
|
|
|
/*!
|
|
|
|
* 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
|
2013-10-09 20:09:59 +00:00
|
|
|
* @extends OO.ui.WindowSet
|
2013-10-04 17:51:44 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.ui.Surface} surface
|
2013-10-15 20:17:39 +00:00
|
|
|
* @param {OO.Factory} factory Window factory
|
2013-10-04 17:51:44 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
|
|
|
ve.ui.SurfaceWindowSet = function VeUiSurfaceWindowSet( surface, factory, config ) {
|
|
|
|
// Parent constructor
|
2013-10-09 20:09:59 +00:00
|
|
|
OO.ui.WindowSet.call( this, factory, config );
|
2013-10-04 17:51:44 +00:00
|
|
|
|
|
|
|
// Properties
|
|
|
|
this.surface = surface;
|
|
|
|
|
|
|
|
// Initialization
|
2013-11-01 19:45:59 +00:00
|
|
|
this.$element.addClass( 've-ui-surfaceWindowSet' );
|
2013-10-04 17:51:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-10-09 20:09:59 +00:00
|
|
|
OO.inheritClass( ve.ui.SurfaceWindowSet, OO.ui.WindowSet );
|
2013-10-04 17:51:44 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.SurfaceWindowSet.prototype.onWindowClose = function ( win, accept ) {
|
|
|
|
this.surface.getView().focus();
|
2013-10-09 20:09:59 +00:00
|
|
|
OO.ui.WindowSet.prototype.onWindowClose.call( this, win, accept );
|
2013-10-04 17:51:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the surface.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
* @returns {ve.ui.Surface} Surface
|
|
|
|
*/
|
|
|
|
ve.ui.SurfaceWindowSet.prototype.getSurface = function () {
|
|
|
|
return this.surface;
|
|
|
|
};
|