mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Focus the search box in the re-use citation dialog
Bug: T91479 Change-Id: I3ad7c99d2fded2d2f21bd210dd57ad9807d88e13
This commit is contained in:
parent
7c0b307d8a
commit
c10483999e
|
@ -20,6 +20,7 @@ ve.ui.MWReferenceDialog = function VeUiMWReferenceDialog( config ) {
|
|||
|
||||
// Properties
|
||||
this.referenceModel = null;
|
||||
this.useExisting = false;
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
@ -193,7 +194,11 @@ ve.ui.MWReferenceDialog.prototype.onSearchSelect = function ( ref ) {
|
|||
ve.ui.MWReferenceDialog.prototype.getReadyProcess = function ( data ) {
|
||||
return ve.ui.MWReferenceDialog.super.prototype.getReadyProcess.call( this, data )
|
||||
.next( function () {
|
||||
this.referenceSurface.focus();
|
||||
if ( this.useExisting ) {
|
||||
this.search.getQuery().focus().select();
|
||||
} else {
|
||||
this.referenceSurface.focus();
|
||||
}
|
||||
}, this );
|
||||
};
|
||||
|
||||
|
@ -396,7 +401,7 @@ ve.ui.MWReferenceDialog.prototype.getSetupProcess = function ( data ) {
|
|||
if ( data.useExisting ) {
|
||||
this.useExistingReference( 'insert-select' );
|
||||
}
|
||||
|
||||
this.useExisting = !!data.useExisting;
|
||||
// If we're using an existing reference, start off disabled
|
||||
// If not, set disabled based on whether or not there are any existing ones.
|
||||
this.actions.setAbilities( {
|
||||
|
|
Loading…
Reference in a new issue