Alex Monk has uploaded a new change for review.

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

Change subject: SET: Don't try to do any client-side section link magic if 
we're not supposed to.
......................................................................

SET: Don't try to do any client-side section link magic if we're not supposed 
to.

Ugh.

Bug: T121599
Change-Id: I47a93d5dbedc5ae989a2973fb793ac99edfb139a
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 10 insertions(+), 1 deletion(-)


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

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 55cd5ff..3c20f4b 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
@@ -20,7 +20,7 @@
 ( function () {
        var conf, tabMessages, uri, pageExists, viewUri, veEditUri, isViewPage, 
isEditPage,
                pageCanLoadVE, init, support, targetPromise, enable, 
tempdisable, autodisable,
-               userPrefEnabled, initialWikitext,
+               userPrefEnabled, initialWikitext, sectionEditLinkMagic,
                active = false,
                progressStep = 0,
                progressSteps = [
@@ -477,6 +477,13 @@
                        var $editsections = $( '#mw-content-text 
.mw-editsection' ),
                                bodyDir = $( 'body' ).css( 'direction' );
 
+                       if ( !sectionEditLinkMagic ) {
+                               // More horrible stuff to prevent the weird 
caller in
+                               // 
ve.init.mw.DesktopArticleTarget.prototype.saveComplete
+                               // from doing any weird magic when we don't 
want to.
+                               return;
+                       }
+
                        // Match direction of the user interface
                        // TODO: Why is this needed? It seems to work fine 
without.
                        if ( $editsections.css( 'direction' ) !== bodyDir ) {
@@ -788,6 +795,7 @@
                                mw.user.options.get( 'visualeditor-tabs' ) !== 
'multi-tab' &&
                                userPrefEnabled
                        ) {
+                               sectionEditLinkMagic = false;
                                if (
                                        pageCanLoadVE && (
                                                mw.user.options.get( 
'visualeditor-tabs' ) === 'prefer-ve' ||
@@ -809,6 +817,7 @@
                                        } );
                                }
                        } else if ( userPrefEnabled ) {
+                               sectionEditLinkMagic = true;
                                init.setupSkin();
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47a93d5dbedc5ae989a2973fb793ac99edfb139a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to