DLynch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343086 )

Change subject: DesktopArticleTarget: Only try to show notices if some exist
......................................................................

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
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/86/343086/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index be17ff4..3bf42d8 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -1598,7 +1598,7 @@
        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 @@
                                        
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 );
+                                       }
                                }
                        } );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/343086
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ad97785f0de4ecf81d189985459689644e25923
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to