diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index d619994e88..6a45cb0573 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -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 */ diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js index fa8c0df454..aaccdaa4d2 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js @@ -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 */ diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js index a48bfa18c4..9344e56785 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js @@ -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. *