Debian Codegraph @

extensions/VisualEditor/lib/ve/src/ui/windowmanagers/ve.ui.ToolbarDialogWindowManager.js

raw symbols SCIP
1 /*!
2 * VisualEditor UserInterface ToolbarDialogWindowManager class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * Window manager for toolbar dialogs.
9 *
10 * @class
11 * @extends ve.ui.SurfaceWindowManager
12 *
13 * @constructor
14 * @param {ve.ui.Surface} surface Surface this belongs to
15 * @param {Object} [config] Configuration options
16 * @param {ve.ui.Overlay} [config.overlay] Overlay to use for menus
17 */
18 ve.ui.ToolbarDialogWindowManager = function VeUiToolbarDialogWindowManager( surface, config ) {
19 // Parent constructor
20 ve.ui.ToolbarDialogWindowManager.super.call( this, surface, config );
21 };
22
23 /* Inheritance */
24
25 OO.inheritClass( ve.ui.ToolbarDialogWindowManager, ve.ui.SurfaceWindowManager );
26
27 /* Static Properties */
28
29 ve.ui.ToolbarDialogWindowManager.static.sizes = {
30 full: {
31 width: '100%',
32 maxHeight: '100%'
33 },
34 small: {
35 width: 150
36 },
37 medium: {
38 width: 300
39 },
40 large: {
41 width: 400
42 }
43 };
44
45 /* Methods */
46
47 /**
48 * @inheritdoc
49 */
50 ve.ui.ToolbarDialogWindowManager.prototype.getTeardownDelay = function () {
51 return 250;
52 };
53
54 /**
55 * Get an object describing the amount of padding the toolbar dialog adds to the surface.
56 *
57 * @return {ve.ui.Surface.Padding|null} Padding object
58 */
59 ve.ui.ToolbarDialogWindowManager.prototype.getSurfacePadding = function () {
60 const currentWindow = this.getCurrentWindow();
61 if ( currentWindow && currentWindow.constructor.static.position === 'below' ) {
62 return { bottom: currentWindow.$frame[ 0 ].clientHeight };
63 } else {
64 return { bottom: 0 };
65 }
66 };