jenkins-bot has submitted this change and it was merged.

Change subject: Simplify some SET logic
......................................................................


Simplify some SET logic

Change-Id: Ie89260607f0253dd7d749af7426702985a0340f4
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 11 insertions(+), 13 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 22e5ea7..5d67b21 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -241,6 +241,7 @@
 
        function getLastEditor() {
                var editor = $.cookie( 'VEE' );
+               // TODO: Check validity?
                if ( !mw.user.isAnon() || !editor ) {
                        editor = mw.user.options.get( 'visualeditor-editor' );
                }
@@ -692,7 +693,7 @@
        }
 
        $( function () {
-               var key, loadVEInPage;
+               var key;
                if ( uri.query.action === 'edit' && $( '#wpTextbox1' ).length ) 
{
                        initialWikitext = $( '#wpTextbox1' ).val();
                }
@@ -768,31 +769,28 @@
                                        } );
                                } );
                        }
+
                        if (
                                conf.singleEditTab &&
                                mw.user.options.get( 'visualeditor-tabs' ) !== 
'multi-tab' &&
-                               userPrefEnabled
-                       ) {
-                               loadVEInPage = pageCanLoadVE && (
+                               userPrefEnabled &&
+                               pageCanLoadVE && (
                                        mw.user.options.get( 
'visualeditor-tabs' ) === 'prefer-ve' ||
                                        (
                                                getLastEditor() !== 'wikitext' 
&&
                                                mw.user.options.get( 
'visualeditor-tabs' ) !== 'prefer-wt'
                                        )
-                               );
+                               )
+                       ) {
                                // Handle section edit link clicks
                                $( '.mw-editsection a' ).on( 'click', function 
( e ) {
-                                       if ( loadVEInPage ) {
-                                               init.onEditSectionLinkClick( e 
);
-                                       }
+                                       init.onEditSectionLinkClick( e );
                                } );
                                // Allow instant switching to edit mode, 
without refresh
                                $( '#ca-edit' ).on( 'click', function ( e ) {
-                                       if ( loadVEInPage ) {
-                                               trackActivateStart( { type: 
'page', mechanism: 'click' } );
-                                               activateTarget();
-                                               e.preventDefault();
-                                       }
+                                       trackActivateStart( { type: 'page', 
mechanism: 'click' } );
+                                       activateTarget();
+                                       e.preventDefault();
                                } );
                        } else if ( userPrefEnabled ) {
                                init.setupSkin();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie89260607f0253dd7d749af7426702985a0340f4
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to