mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-12 06:27:01 +00:00
Dialogs: Go back or close when pressing escape
Decide based on the currently available actions. Change-Id: Ida805efbf14071967bf2359788486028fb6c9a09
This commit is contained in:
parent
6a26905d87
commit
03b557f167
|
@ -173,6 +173,17 @@ ve.ui.MWMediaDialog.static.getImportRules = function () {
|
|||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWMediaDialog.prototype.getEscapeAction = function () {
|
||||
const backOrClose = this.actions.get( { flags: [ 'back', 'close' ], visible: true } );
|
||||
if ( backOrClose.length ) {
|
||||
return backOrClose[ 0 ].getAction();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
|
|
@ -876,6 +876,17 @@ ve.ui.MWSaveDialog.prototype.getTeardownProcess = function ( data ) {
|
|||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWSaveDialog.prototype.getEscapeAction = function () {
|
||||
const backOrClose = this.actions.get( { flags: [ 'back', 'close' ], visible: true } );
|
||||
if ( backOrClose.length ) {
|
||||
return backOrClose[ 0 ].getAction();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
|
|
@ -68,6 +68,17 @@ ve.ui.MWTransclusionDialog.static.isSmallScreen = function () {
|
|||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWTransclusionDialog.prototype.getEscapeAction = function () {
|
||||
const backOrClose = this.actions.get( { flags: [ 'back', 'close' ], visible: true } );
|
||||
if ( backOrClose.length ) {
|
||||
return backOrClose[ 0 ].getAction();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle outline controls move events.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue