From 67a51aee9b8ce440807bd3bcc9d787a793e3aec8 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Fri, 20 Nov 2015 00:10:38 +0000 Subject: [PATCH] Prevent switching from unedited section directly into VE Bug: T117713 Change-Id: Iee9ae2bbe4757cb07e9aa2bd5f41a46c0ebb391a --- .../init/targets/ve.init.mw.DesktopArticleTarget.init.js | 5 ++++- 1 file changed, 4 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 468ce54c57..9eb732ebfb 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 @@ -535,7 +535,10 @@ if ( mw.config.get( 'wgAction' ) === 'submit' || - ( mw.config.get( 'wgAction' ) === 'edit' && wikitextModified ) + ( mw.config.get( 'wgAction' ) === 'edit' && wikitextModified ) || + // switching from section editing must prompt because we can't + // keep changes from that (yet?) + $( 'input[name=wpSection]' ).val() ) { mw.loader.using( 'ext.visualEditor.switching' ) .done( function () {