mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
DesktopArticleTarget: Only try to show notices if some exist
This avoids an OOui deprecation warning for trying to toggle a popup which isn't connected to anything. Bug: T160161 Change-Id: I9ad97785f0de4ecf81d189985459689644e25923
This commit is contained in:
parent
cf94956fba
commit
eb8ba26adf
|
@ -1598,7 +1598,7 @@ ve.init.mw.DesktopArticleTarget.prototype.maybeShowMetaDialog = function () {
|
|||
if ( this.welcomeDialogPromise ) {
|
||||
this.welcomeDialogPromise
|
||||
.always( function () {
|
||||
var noticesTool, popup;
|
||||
var noticesTool, popup, notices;
|
||||
// Pop out the notices when the welcome dialog is closed
|
||||
if (
|
||||
target.switched &&
|
||||
|
@ -1608,9 +1608,12 @@ ve.init.mw.DesktopArticleTarget.prototype.maybeShowMetaDialog = function () {
|
|||
target.actionsToolbar.tools.editModeSource.toolGroup.$element.append( popup.$element );
|
||||
popup.toggle( true );
|
||||
} else {
|
||||
noticesTool = target.actionsToolbar.tools.notices;
|
||||
noticesTool.setNotices( target.getEditNotices() );
|
||||
noticesTool.getPopup().toggle( true );
|
||||
notices = target.getEditNotices();
|
||||
if ( notices.length ) {
|
||||
noticesTool = target.actionsToolbar.tools.notices;
|
||||
noticesTool.setNotices( notices );
|
||||
noticesTool.getPopup().toggle( true );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue