Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7425608
ve.ui.MWFloatingHelpElement.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.ui.MWFloatingHelpElement.js
View Options
/*!
* VisualEditor UserInterface MWFloatingHelpElement class.
*
* @copyright See AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Question-mark button which floats over content, currently used in the
* template dialog. Clicking pops up a help screen.
*
* @class
* @extends OO.ui.Element
*
* @constructor
* @param {Object} config
* @param {string} config.label
* @param {jQuery} config.$message
*/
ve
.
ui
.
MWFloatingHelpElement
=
function
VeUiMWFloatingHelpElement
(
config
)
{
// Parent constructor
ve
.
ui
.
MWFloatingHelpElement
.
super
.
call
(
this
,
config
);
this
.
helpDialog
=
new
ve
.
ui
.
MWFloatingHelpDialog
(
config
);
this
.
helpButton
=
new
OO
.
ui
.
ButtonWidget
(
{
icon
:
'help'
,
label
:
config
.
label
,
title
:
config
.
title
,
invisibleLabel
:
true
,
flags
:
'progressive'
,
rel
:
'help'
,
classes
:
[
've-ui-mwFloatingHelpElement-toggle'
]
}
).
connect
(
this
,
{
click
:
'onClick'
}
);
this
.
windowManager
=
new
OO
.
ui
.
WindowManager
();
this
.
windowManager
.
addWindows
(
[
this
.
helpDialog
]
);
this
.
windowManager
.
$element
.
addClass
(
've-ui-mwFloatingHelpElement-windowManager'
);
if
(
OO
.
ui
.
isMobile
()
)
{
$
(
OO
.
ui
.
getTeleportTarget
()
).
append
(
this
.
windowManager
.
$element
);
}
else
{
this
.
$element
.
append
(
this
.
windowManager
.
$element
);
}
this
.
$element
.
addClass
(
've-ui-mwFloatingHelpElement'
)
.
append
(
this
.
helpButton
.
$element
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
MWFloatingHelpElement
,
OO
.
ui
.
Element
);
/* Methods */
ve
.
ui
.
MWFloatingHelpElement
.
prototype
.
onClick
=
function
()
{
if
(
!
this
.
helpButton
.
hasFlag
(
'primary'
)
)
{
const
window
=
this
.
windowManager
.
openWindow
(
this
.
helpDialog
);
window
.
opening
.
then
(
this
.
updateButton
.
bind
(
this
,
true
)
);
window
.
closing
.
then
(
this
.
updateButton
.
bind
(
this
,
false
)
);
}
else
{
this
.
windowManager
.
closeWindow
(
this
.
helpDialog
);
}
};
ve
.
ui
.
MWFloatingHelpElement
.
prototype
.
updateButton
=
function
(
isOpen
)
{
this
.
helpButton
.
setIcon
(
isOpen
?
'expand'
:
'help'
)
.
setFlags
(
{
primary
:
isOpen
}
);
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 08:00 (1 d, 3 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
eb/ba/c54f4ced056a96c77ffe2594bd47
Default Alt Text
ve.ui.MWFloatingHelpElement.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment