Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7431995
ve.ui.SidebarDialogWindowManager.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ve.ui.SidebarDialogWindowManager.js
View Options
/*!
* VisualEditor UserInterface SidebarDialogWindowManager class.
*
* @copyright See AUTHORS.txt
*/
/**
* Window manager for sidebar dialogs.
*
* @class
* @extends ve.ui.SurfaceWindowManager
*
* @constructor
* @param {ve.ui.Surface} surface Surface this belongs to
* @param {Object} [config] Configuration options
* @param {ve.ui.Overlay} [config.overlay] Overlay to use for menus
*/
ve
.
ui
.
SidebarDialogWindowManager
=
function
VeUiSidebarDialogWindowManager
(
surface
,
config
)
{
// Parent constructor
ve
.
ui
.
SidebarDialogWindowManager
.
super
.
call
(
this
,
surface
,
ve
.
extendObject
(
{
modal
:
false
},
config
)
);
this
.
$element
.
addClass
(
've-ui-sidebarDialogWindowManager'
);
this
.
connect
(
this
,
{
opening
:
'onSidebarDialogsOpeningOrClosing'
,
closing
:
'onSidebarDialogsOpeningOrClosing'
}
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
SidebarDialogWindowManager
,
ve
.
ui
.
SurfaceWindowManager
);
/* Static Properties */
ve
.
ui
.
SidebarDialogWindowManager
.
static
.
sizes
=
{
gutter
:
{
width
:
44
,
height
:
'100%'
},
small
:
{
width
:
150
,
height
:
'100%'
},
medium
:
{
width
:
300
,
height
:
'100%'
},
large
:
{
width
:
400
,
height
:
'100%'
}
};
/* Methods */
/**
* Handle windows opening or closing.
*
* @param {OO.ui.Window} win
* @param {jQuery.Promise} openingOrClosing
* @param {Object} data
*/
ve
.
ui
.
SidebarDialogWindowManager
.
prototype
.
onSidebarDialogsOpeningOrClosing
=
function
(
win
,
openingOrClosing
)
{
const
transitionDuration
=
OO
.
ui
.
theme
.
getDialogTransitionDuration
();
// win.isOpened before promise means we are closing
const
isClosing
=
win
.
isOpened
();
if
(
isClosing
)
{
win
.
$element
.
css
(
'width'
,
''
);
}
// The following classes are generated here:
// * ve-ui-surface-sidebarOpen-gutter
// * ve-ui-surface-sidebarOpen-small
// * ve-ui-surface-sidebarOpen-medium
// * ve-ui-surface-sidebarOpen-large
this
.
getSurface
().
$element
.
toggleClass
(
've-ui-surface-sidebarOpen ve-ui-surface-sidebarOpen-'
+
win
.
getSize
(),
!
isClosing
);
openingOrClosing
.
then
(
()
=>
{
// win.isOpened after promise means we are opening
if
(
win
.
isOpened
()
)
{
win
.
$element
.
css
(
'width'
,
win
.
getSizeProperties
().
width
);
}
setTimeout
(
()
=>
{
this
.
getSurface
().
getView
().
emit
(
'position'
);
},
transitionDuration
);
}
);
};
/**
* @inheritdoc
*/
ve
.
ui
.
SidebarDialogWindowManager
.
prototype
.
getTeardownDelay
=
function
()
{
return
250
;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 11:11 (6 h, 34 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d2/39/b240532312192a0180218232d34d
Default Alt Text
ve.ui.SidebarDialogWindowManager.js (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment