Commit 78d1a31e authored by Gergő Tisza's avatar Gergő Tisza Committed by Gergő Tisza
Browse files

Allow replacing the default post-edit notification

* check the wgPostEditConfirmationDisabled mw.config flag
  (to be introduced in Idff34615a48) and do not prepare a
  save success notification if set
* add a postEditMobile hook that works just like core's postEdit
  hook

Bug: T245790
Depends-On: Idff34615a48ffa81e6e49a3efb5c66bd8753586c
Change-Id: I130c9e2164da3985341040ef880dde800df62e4e
parent 2e27f971
No related merge requests found
Showing with 11 additions and 1 deletion
+11 -1
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -242,7 +242,17 @@ mfExtend( EditorOverlayBase, Overlay, {
} else {
msg = mw.msg( 'mobile-frontend-editor-success' );
}
toast.showOnPageReload( msg, { type: 'success' } );
/**
* Fired after an edit was successfully saved, like postEdit in MediaWiki core.
*
* @event postEditMobile
* @member mw.hook
*/
mw.hook( 'postEditMobile' ).fire();
if ( !mw.config.get( 'wgPostEditConfirmationDisabled' ) ) {
toast.showOnPageReload( msg, { type: 'success' } );
}
// Ensure we don't lose this event when logging
this.log( {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment