mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
Fix abandon edit warning message
This message was upstreamed to core and later renamed. Use the upstreamed dialog itself when switching sections. Bug: T222525 Change-Id: Ibd2d75ec503e92b5ddec2105f762b0c9f0dc96fb
This commit is contained in:
parent
0bc3c81978
commit
c035073cf9
|
@ -438,6 +438,7 @@
|
||||||
"creating",
|
"creating",
|
||||||
"editing",
|
"editing",
|
||||||
"lastmodifiedat",
|
"lastmodifiedat",
|
||||||
|
"mw-widgets-abandonedit",
|
||||||
"redirectpagesub",
|
"redirectpagesub",
|
||||||
"subject",
|
"subject",
|
||||||
"visualeditor-loadwarning",
|
"visualeditor-loadwarning",
|
||||||
|
|
|
@ -1502,7 +1502,7 @@ ve.init.mw.DesktopArticleTarget.prototype.onBeforeUnload = function () {
|
||||||
mw.user.options.get( 'useeditwarning' )
|
mw.user.options.get( 'useeditwarning' )
|
||||||
) {
|
) {
|
||||||
// Return our message
|
// Return our message
|
||||||
return ve.msg( 'visualeditor-viewpage-savewarning' );
|
return ve.msg( 'mw-widgets-abandonedit' );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2404,7 +2404,10 @@ ve.init.mw.ArticleTarget.prototype.switchToWikitextSection = function ( section,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( !noConfirm && this.edited && mw.user.options.get( 'useeditwarning' ) ) {
|
if ( !noConfirm && this.edited && mw.user.options.get( 'useeditwarning' ) ) {
|
||||||
promise = OO.ui.confirm( mw.msg( 'visualeditor-viewpage-savewarning' ) );
|
promise = this.getSurface().dialogs.openWindow( 'abandonedit' )
|
||||||
|
.closed.then( function ( data ) {
|
||||||
|
return data && data.action === 'discard';
|
||||||
|
} );
|
||||||
} else {
|
} else {
|
||||||
promise = $.Deferred().resolve( true ).promise();
|
promise = $.Deferred().resolve( true ).promise();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue