Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74522


Change subject: Don't show GettingStarted toolbar when VisualEditor is open
......................................................................

Don't show GettingStarted toolbar when VisualEditor is open

Uses VE activation and deactivation hooks.

Change-Id: I3dead18e31a9ab56e2c26c1516060cc98727c6e6
---
M resources/ext.gettingstarted.taskToolbar.js
1 file changed, 14 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted 
refs/changes/22/74522/1

diff --git a/resources/ext.gettingstarted.taskToolbar.js 
b/resources/ext.gettingstarted.taskToolbar.js
index e7f9b5f..31f05f9 100644
--- a/resources/ext.gettingstarted.taskToolbar.js
+++ b/resources/ext.gettingstarted.taskToolbar.js
@@ -103,10 +103,7 @@
                        // Clear task
                        logging.setTask( title.getPrefixedText(), null );
 
-                       $toolbar.slideUp( 200, function () {
-                               $relativeElements.removeClass( 
'mw-gettingstarted-relative-vshift' );
-                               $marginElements.removeClass( 
'mw-gettingstarted-margin-vshift' );
-                       } );
+                       hideToolbar();
                } );
 
                $right = $( '<div>' ).attr( {
@@ -122,6 +119,9 @@
                $relativeElements = $( '#mw-page-base, #mw-head-base, #content, 
#footer' );
                $marginElements = $( '#mw-head, #mw-panel' );
 
+
+               // This intentionally logs again if the toolbar redisplays 
after VE is hidden,
+               // either due to a save or simply returning to Read.
                function showToolbarInternal() {
                        $relativeElements.addClass( 
'mw-gettingstarted-relative-vshift' );
                        $marginElements.addClass( 
'mw-gettingstarted-margin-vshift' );
@@ -131,6 +131,13 @@
 
                                logging.logImpression( fullTask, schemaAction );
                                mw.libs.guiders.reposition();
+                       } );
+               }
+
+               function hideToolbar() {
+                       $toolbar.slideUp( 200, function () {
+                               $relativeElements.removeClass( 
'mw-gettingstarted-relative-vshift' );
+                               $marginElements.removeClass( 
'mw-gettingstarted-margin-vshift' );
                        } );
                }
 
@@ -153,5 +160,8 @@
                        $showGuide.css( 'opacity', 1 );
                        showToolbar();
                }
+
+               mw.hook( 've.activationComplete' ).add( hideToolbar );
+               mw.hook( 've.deactivationComplete' ).add( showToolbarInternal );
        } );
 } ( jQuery, mediaWiki ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3dead18e31a9ab56e2c26c1516060cc98727c6e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

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

Reply via email to