mediawiki-extensions-Visual.../modules/ve/ui/ve.ui.WindowSet.js
Trevor Parscal 4192cbc4d5 Window refactor
Changes:

* Cleanup the window API to use more consistent and intuitive methods - we
  now use initialize/setup/teardown instead of
  initialize/onSetup/onOpen/onClose as methods which are overridden, and
  use open/close methods to control the window
* Change events around to have opening/open and closing/close events which
  act as before/after points during the opening/closing process
* Make WindowSet and Context respond to windows being opened, rather than
  opening them directly
* Fix a LinkInspector creation mode bug where the initial text doesn't get
  reset
* Move inspector, a VisualEditor concept, back to VE
* Cleanup naming of SurfaceDialog, SurfaceToolbar, etc. to use shorter
  names, they were given Surface* names when the generic ones were also in
  VE, but now the generic ones are in OO, so they can return to their
  original names

Change-Id: I82c4fed8bcb3fb5630938c8bc4dd9b2d5f1a8c1d
2013-11-08 12:33:25 -08:00

53 lines
1.1 KiB
JavaScript

/*!
* VisualEditor UserInterface WindowSet 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 OO.ui.WindowSet
*
* @constructor
* @param {ve.ui.Surface} surface
* @param {OO.Factory} factory Window factory
* @param {Object} [config] Configuration options
*/
ve.ui.WindowSet = function VeUiWindowSet( surface, factory, config ) {
// Parent constructor
OO.ui.WindowSet.call( this, factory, config );
// Properties
this.surface = surface;
// Initialization
this.$element.addClass( 've-ui-windowSet' );
};
/* Inheritance */
OO.inheritClass( ve.ui.WindowSet, OO.ui.WindowSet );
/* Methods */
/**
* @inheritdoc
*/
ve.ui.WindowSet.prototype.onWindowClose = function ( win, accept ) {
this.surface.getView().focus();
OO.ui.WindowSet.prototype.onWindowClose.call( this, win, accept );
};
/**
* Get the surface.
*
* @method
* @returns {ve.ui.Surface} Surface
*/
ve.ui.WindowSet.prototype.getSurface = function () {
return this.surface;
};