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

Change subject: Bug 49557: Fix talk topic add overlay
......................................................................


Bug 49557: Fix talk topic add overlay

* Run _super to ensure that parent is opened on a close
* invalidate cache so that when the talk button is clicked on again it
loads the new talk page content
* Hide the button bar when save is clicked to prevent duplicate edits
with the same content

Change-Id: I6775efa41e098c015af30c63c68af8f66f58fc0f
---
M javascripts/modules/talk.js
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/javascripts/modules/talk.js b/javascripts/modules/talk.js
index a4c861a..ac0ad9e 100644
--- a/javascripts/modules/talk.js
+++ b/javascripts/modules/talk.js
@@ -15,6 +15,7 @@
                        },
                        template: M.template.get( 'overlays/talkSectionAdd' ),
                        initialize: function( options ) {
+                               this._super( options );
                                this.talkOverlay = options.parent;
                                this.title = 'Talk:' + mw.config.get( 'wgTitle' 
);
                        },
@@ -32,6 +33,7 @@
                                $subject.removeClass( 'error' );
                                if ( text && heading ) {
                                        this.$( '.content' ).empty().addClass( 
'loading' );
+                                       this.$( '.buttonBar' ).hide();
                                        api.getToken().done( function( token ) {
                                                api.post( {
                                                        action: 'edit',
@@ -43,6 +45,7 @@
                                                        text: text + ' ~~~~'
                                                } ).done( function() {
                                                        self.hide();
+                                                       
M.history.invalidateCachedPage( self.title );
                                                        
self.talkOverlay.appendSection( { heading: heading, content: text } ); // 
FIXME: doesn't add signature and doesn't wikify
                                                } );
                                        } );

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

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

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

Reply via email to