From 50dae0ab1657032e7b9ff0f344fd223d15e20905 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Tue, 29 Jul 2014 15:34:09 -0400 Subject: [PATCH] Focus the caption surface on initialization Whenever the edit mode is active, focus the caption surface. This is also true for cases where the dialog starts in the 'insert' mode and then switches to 'edit'. Bug: 68806 Change-Id: I60b862dc5738a65a6bb31eb32184c35cc108b232 --- modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index 98ae27a3bd..a799a59fd7 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -645,6 +645,8 @@ ve.ui.MWMediaDialog.prototype.switchPanels = function ( panel ) { this.actions.setMode( this.selectedNode ? 'edit' : 'insert' ); // HACK: OO.ui.Dialog needs an API for this this.frame.$content.removeClass( 'oo-ui-dialog-content-footless' ); + // Focus the caption surface + this.captionSurface.focus(); // Hide/show the panels this.bookletLayout.$element.show(); this.mediaSearchPanel.$element.hide();