2013-10-04 17:51:44 +00:00
|
|
|
/*!
|
2013-11-05 00:29:50 +00:00
|
|
|
* VisualEditor UserInterface WindowSet class.
|
2013-10-04 17:51:44 +00:00
|
|
|
*
|
|
|
|
* @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
|
|
|
|
*/
|
2013-11-05 00:29:50 +00:00
|
|
|
ve.ui.WindowSet = function VeUiWindowSet( surface, factory, config ) {
|
2013-10-04 17:51:44 +00:00
|
|
|
// 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-05 00:29:50 +00:00
|
|
|
this.$element.addClass( 've-ui-windowSet' );
|
2013-10-04 17:51:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-11-05 00:29:50 +00:00
|
|
|
OO.inheritClass( ve.ui.WindowSet, OO.ui.WindowSet );
|
2013-10-04 17:51:44 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2013-11-05 00:29:50 +00:00
|
|
|
ve.ui.WindowSet.prototype.onWindowClose = function ( win, accept ) {
|
2013-10-04 17:51:44 +00:00
|
|
|
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
|
|
|
|
*/
|
2013-11-05 00:29:50 +00:00
|
|
|
ve.ui.WindowSet.prototype.getSurface = function () {
|
2013-10-04 17:51:44 +00:00
|
|
|
return this.surface;
|
|
|
|
};
|