mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Hack to not show menu immediately upon meta dialog opening for redirect change"
This commit is contained in:
commit
4a7f208e53
|
@ -195,10 +195,24 @@ ve.ui.MWSettingsPage.prototype.onTableOfContentsFieldChange = function () {
|
|||
* @param {boolean} value Whether a redirect is to be set for this page
|
||||
*/
|
||||
ve.ui.MWSettingsPage.prototype.onEnableRedirectChange = function ( value ) {
|
||||
var page = this;
|
||||
this.redirectTargetInput.setDisabled( !value );
|
||||
this.enableStaticRedirectInput.setDisabled( !value );
|
||||
if ( value ) {
|
||||
this.redirectTargetInput.focus();
|
||||
/*
|
||||
* HACK: When editing a page which has a redirect, the meta dialog
|
||||
* automatically opens with the settings page's redirect field focused.
|
||||
* When this happens, we don't want the lookup dropdown to appear until
|
||||
* the user actually does something.
|
||||
* Using setTimeout because we need to defer this until after the
|
||||
* dialog has opened - otherwise its internal lookupDisabled logic will
|
||||
* fail to have any effect during the actual focusing and calling of
|
||||
* OO.ui.LookupElement#onLookupInputFocus/OO.ui.LookupElement#populateLookupMenu.
|
||||
* https://phabricator.wikimedia.org/T137309
|
||||
*/
|
||||
setTimeout( function () {
|
||||
page.redirectTargetInput.focus();
|
||||
} );
|
||||
} else {
|
||||
this.redirectTargetInput.setValue( '' );
|
||||
this.enableStaticRedirectInput.setSelected( false );
|
||||
|
|
Loading…
Reference in a new issue