mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-03 18:36:20 +00:00
44f4068ecb
As this is a surface command, rather than a documentTrigger, pressing escape will not close the editor if done elsewhere on the page, e.g. in the site search bar, or an unrelated modal. Move the logic to ArticleTarget as this could theoretically work on the mobile site with a keyboard. Allows us to remove some hacks around the ToolbarDialog that are no longer necessary. The command can also be used by the MWBackTool (which should be renamed) and allows us to remove some custom logic from it. Bug: T310694 Bug: T310695 Bug: T306763 Change-Id: I91ee6916a91d80d9872b3b44dad7eca55ad1acc4 Depends-On: I29f6af4cc7c71a63a6d1bafc53d16b9abd1b60ec
24 lines
693 B
JavaScript
24 lines
693 B
JavaScript
/*!
|
|
* VisualEditor MediaWiki UserInterface back tool classes.
|
|
*
|
|
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Back tool
|
|
*/
|
|
ve.ui.MWBackTool = function VeUiMwBackTool() {
|
|
// Parent constructor
|
|
ve.ui.MWBackTool.super.apply( this, arguments );
|
|
};
|
|
OO.inheritClass( ve.ui.MWBackTool, ve.ui.Tool );
|
|
ve.ui.MWBackTool.static.name = 'back';
|
|
ve.ui.MWBackTool.static.commandName = 'cancel';
|
|
ve.ui.MWBackTool.static.group = 'navigation';
|
|
ve.ui.MWBackTool.static.icon = 'close';
|
|
ve.ui.MWBackTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-backbutton-tooltip' );
|
|
|
|
ve.ui.toolFactory.register( ve.ui.MWBackTool );
|