Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7419679
ve.ce.LinearEscapeKeyDownHandler.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.ce.LinearEscapeKeyDownHandler.js
View Options
/*!
* VisualEditor ContentEditable linear escape key down handler
*
* @copyright See AUTHORS.txt
*/
/* istanbul ignore next */
/**
* Escape key down handler for linear selections.
*
* @class
* @extends ve.ce.KeyDownHandler
*
* @constructor
*/
ve
.
ce
.
LinearEscapeKeyDownHandler
=
function
VeCeLinearEscapeKeyDownHandler
()
{
// Parent constructor - never called because class is fully static
// ve.ui.LinearEscapeKeyDownHandler.super.apply( this, arguments );
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ce
.
LinearEscapeKeyDownHandler
,
ve
.
ce
.
KeyDownHandler
);
/* Static properties */
ve
.
ce
.
LinearEscapeKeyDownHandler
.
static
.
name
=
'linearEscape'
;
ve
.
ce
.
LinearEscapeKeyDownHandler
.
static
.
keys
=
[
OO
.
ui
.
Keys
.
ESCAPE
];
ve
.
ce
.
LinearEscapeKeyDownHandler
.
static
.
supportedSelections
=
[
'linear'
];
/* Static methods */
/**
* Handle escape key down events with a linear selection while table editing.
*
* @inheritdoc
*/
ve
.
ce
.
LinearEscapeKeyDownHandler
.
static
.
execute
=
function
(
surface
,
e
)
{
const
activeTableNode
=
surface
.
getActiveNode
()
&&
surface
.
getActiveNode
().
findParent
(
ve
.
ce
.
TableNode
);
if
(
activeTableNode
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
activeTableNode
.
setEditing
(
false
);
// If this was a merged cell, we're going to have unexpected behavior when the selection moves,
// so preemptively collapse to the top-left point of the merged cell.
surface
.
getModel
().
setSelection
(
surface
.
getModel
().
getSelection
().
collapseToStart
()
);
return
true
;
}
return
false
;
};
/* Registration */
ve
.
ce
.
keyDownHandlerFactory
.
register
(
ve
.
ce
.
LinearEscapeKeyDownHandler
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 04:36 (1 d, 5 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
36/bf/96150831ea460ed9ab4236211bd7
Default Alt Text
ve.ce.LinearEscapeKeyDownHandler.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment