jenkins-bot has submitted this change and it was merged.

Change subject: Redirect to Section, if possible, after edit
......................................................................


Redirect to Section, if possible, after edit

If there is a sectionline returned by editor Preview, we can use it
to redirect to the section, the user has edited after the edit was
successful.

Change-Id: I98e82c2036f02cd67a5f423a05f967b3318b2634
---
M javascripts/modules/editor/EditorOverlayBase.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Robmoen: Looks good to me, approved
  jenkins-bot: Verified

Objections:
  Jdlrobson: There's a problem with this change, please improve



diff --git a/javascripts/modules/editor/EditorOverlayBase.js 
b/javascripts/modules/editor/EditorOverlayBase.js
index f0c1890..db31367 100644
--- a/javascripts/modules/editor/EditorOverlayBase.js
+++ b/javascripts/modules/editor/EditorOverlayBase.js
@@ -78,7 +78,7 @@
                 * messages, and setting mobile edit cookie.
                 */
                onSave: function () {
-                       var title = this.options.title,
+                       var title = this.options.title, self = this,
                                msg;
 
                        // FIXME: use generic method for following 3 lines
@@ -97,6 +97,10 @@
 
                        // Ensure we don't lose this event when logging
                        this.log( 'success' ).always( function () {
+                               if ( self.sectionLine ) {
+                                       title = title + '#' + self.sectionLine;
+                               }
+
                                window.location = mw.util.getUrl( title );
                        } );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/172111
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I98e82c2036f02cd67a5f423a05f967b3318b2634
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to