From 3dd1a99660cd9276763cf0de83641550cfea33b3 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Tue, 1 Jul 2014 01:01:39 +0100 Subject: [PATCH] Don't offer to retain changes when switching to wikitext editor by tab if no changes have been made Bug: 57462 Change-Id: Ifa978447a5b6215ebdafdfd4fa8056a1ee11aea5 --- modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 2dc7ba0843..efcaeb9f82 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -1097,8 +1097,10 @@ ve.init.mw.ViewPageTarget.prototype.setupSkinTabs = function () { .click( ve.bind( this.onViewTabClick, this ) ); $( '#ca-viewsource, #ca-edit' ).click( function ( e ) { - viewPageTarget.editSource(); - e.preventDefault(); + if ( viewPageTarget.surface.getModel().hasBeenModified() ) { + viewPageTarget.editSource(); + e.preventDefault(); + } } ); }