All files / src/ui/windowmanagers ve.ui.ToolbarDialogWindowManager.js

81.81% Statements 9/11
75% Branches 3/4
66.66% Functions 2/3
81.81% Lines 9/11

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 57 58 59 60 61 62 63 64 65 66 67                                  1x   5x         1x       1x                                         1x                 1x 61x 61x     61x      
/*!
 * VisualEditor UserInterface ToolbarDialogWindowManager class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * Window manager for toolbar dialogs.
 *
 * @class
 * @extends ve.ui.SurfaceWindowManager
 *
 * @constructor
 * @param {ve.ui.Surface} surface Surface this belongs to
 * @param {Object} [config] Configuration options
 * @cfg {ve.ui.Overlay} [overlay] Overlay to use for menus
 */
ve.ui.ToolbarDialogWindowManager = function VeUiToolbarDialogWindowManager( surface, config ) {
	// Parent constructor
	ve.ui.ToolbarDialogWindowManager.super.call( this, surface, config );
};
 
/* Inheritance */
 
OO.inheritClass( ve.ui.ToolbarDialogWindowManager, ve.ui.SurfaceWindowManager );
 
/* Static Properties */
 
ve.ui.ToolbarDialogWindowManager.static.sizes = {
	full: {
		width: '100%',
		maxHeight: '100%'
	},
	small: {
		width: 150
	},
	medium: {
		width: 300
	},
	large: {
		width: 400
	}
};
 
/* Methods */
 
/**
 * @inheritdoc
 */
ve.ui.ToolbarDialogWindowManager.prototype.getTeardownDelay = function () {
	return 250;
};
 
/**
 * Get an object describing the amount of padding the toolbar dialog adds to the surface.
 *
 * @return {null|Object} Padding object, or null
 */
ve.ui.ToolbarDialogWindowManager.prototype.getSurfacePadding = function () {
	var currentWindow = this.getCurrentWindow();
	Iif ( currentWindow && currentWindow.constructor.static.position === 'below' ) {
		return { bottom: currentWindow.$frame[ 0 ].clientHeight };
	} else {
		return { bottom: 0 };
	}
};