Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172111

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/11/172111/1

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: newchange
Gerrit-Change-Id: I98e82c2036f02cd67a5f423a05f967b3318b2634
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>

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

Reply via email to