From 76cb69ecec8dd473210b8dc536d1b8b8970ec539 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Thu, 17 Dec 2015 02:34:11 +0000 Subject: [PATCH] SET: Don't try to do any client-side section link magic if we're not supposed to. Ugh. Bug: T121599 Change-Id: I47a93d5dbedc5ae989a2973fb793ac99edfb139a --- .../targets/ve.init.mw.DesktopArticleTarget.init.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 55cd5ff393..d43a7752e4 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, multipleSectionEditLinks, active = false, progressStep = 0, progressSteps = [ @@ -477,6 +477,14 @@ var $editsections = $( '#mw-content-text .mw-editsection' ), bodyDir = $( 'body' ).css( 'direction' ); + if ( !multipleSectionEditLinks ) { + // More horrible stuff to prevent the weird caller in + // ve.init.mw.DesktopArticleTarget.prototype.saveComplete + // from having any effect when we wouldn't normally get + // called at all. + 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 +796,7 @@ mw.user.options.get( 'visualeditor-tabs' ) !== 'multi-tab' && userPrefEnabled ) { + multipleSectionEditLinks = false; if ( pageCanLoadVE && ( mw.user.options.get( 'visualeditor-tabs' ) === 'prefer-ve' || @@ -809,6 +818,7 @@ } ); } } else if ( userPrefEnabled ) { + multipleSectionEditLinks = true; init.setupSkin(); } }