All files / src/ui ve.ui.WindowManager.js

90% Statements 9/10
75% Branches 3/4
66.66% Functions 2/3
90% Lines 9/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56                                1x   14x     14x     14x         14x         1x                 1x 12x               1x      
/*!
 * VisualEditor UserInterface WindowManager class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * Window manager.
 *
 * @class
 * @extends OO.ui.WindowManager
 *
 * @constructor
 * @param {Object} [config] Configuration options
 * @param {ve.ui.Overlay} [config.overlay] Overlay to use for menus
 */
ve.ui.WindowManager = function VeUiWindowManager( config ) {
	// Configuration initialization
	config = config || {};
 
	// Parent constructor
	ve.ui.WindowManager.super.call( this, config );
 
	// Properties
	this.overlay = config.overlay || null;
 
	// The following classes are used here:
	// * ve-ui-dir-block-ltr
	// * ve-ui-dir-block-rtl
	this.$element.addClass( 've-ui-dir-block-' + this.getDir() );
};
 
/* Inheritance */
 
OO.inheritClass( ve.ui.WindowManager, OO.ui.WindowManager );
 
/* Methods */
 
/**
 * Get directionality.
 *
 * @return {string} UI directionality
 */
ve.ui.WindowManager.prototype.getDir = function () {
	return $( document.body ).css( 'direction' );
};
 
/**
 * Get overlay for menus.
 *
 * @return {ve.ui.Overlay|null} Menu overlay, null if none was configured
 */
ve.ui.WindowManager.prototype.getOverlay = function () {
	return this.overlay;
};