Check useeditwarning preference before showing warning when browsing away from editor

Bug: 51057
Change-Id: Ic4b02372e6e08d3a0d36457457a2e2bbfbaa797d
This commit is contained in:
Alex Monk 2014-04-17 15:57:10 +01:00
parent 4c0221c09c
commit ca547a7f7c

View file

@ -1569,7 +1569,7 @@ ve.init.mw.ViewPageTarget.prototype.onBeforeUnload = function () {
return null; return null;
} }
// Check if there's been an edit // Check if there's been an edit
if ( this.surface && this.edited ) { if ( this.surface && this.edited && mw.user.options.get( 'useeditwarning' ) ) {
// Return our message // Return our message
message = ve.msg( 'visualeditor-viewpage-savewarning' ); message = ve.msg( 'visualeditor-viewpage-savewarning' );
} }