mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-24 10:58:20 +00:00
Change updating page content after saving to avoid losing footers
This is the same method as used by VisualEditor (ve.init.mw.DesktopArticleTarget.prototype.replacePageContent). Bug: T275698 Change-Id: Idcf7c79b8d5565b0ae36c6e9d42b66662c1acc8d
This commit is contained in:
parent
fb066eda46
commit
4e8e1bda67
|
@ -546,7 +546,8 @@ function init( $container, state ) {
|
|||
|
||||
function update( data, comment, pageName, replyWidget ) {
|
||||
var api = getApi(),
|
||||
pageUpdated = $.Deferred();
|
||||
pageUpdated = $.Deferred(),
|
||||
$content;
|
||||
|
||||
// We posted a new comment, clear the cache, because wgCurRevisionId will not change if we posted
|
||||
// to a transcluded page (T266275)
|
||||
|
@ -560,7 +561,8 @@ function update( data, comment, pageName, replyWidget ) {
|
|||
// Update page state
|
||||
if ( pageName === mw.config.get( 'wgRelevantPageName' ) ) {
|
||||
// We can use the result from the VisualEditor API
|
||||
$pageContainer.html( data.content );
|
||||
$content = $( $.parseHTML( data.content ) );
|
||||
$pageContainer.find( '.mw-parser-output' ).replaceWith( $content );
|
||||
mw.config.set( {
|
||||
wgCurRevisionId: data.newrevid,
|
||||
wgRevisionId: data.newrevid
|
||||
|
@ -592,7 +594,8 @@ function update( data, comment, pageName, replyWidget ) {
|
|||
page: mw.config.get( 'wgRelevantPageName' )
|
||||
} );
|
||||
} ).then( function ( parseResp ) {
|
||||
$pageContainer.html( parseResp.parse.text );
|
||||
$content = $( $.parseHTML( parseResp.parse.text ) );
|
||||
$pageContainer.find( '.mw-parser-output' ).replaceWith( $content );
|
||||
mw.config.set( parseResp.parse.jsconfigvars );
|
||||
mw.loader.load( parseResp.parse.modulestyles );
|
||||
mw.loader.load( parseResp.parse.modules );
|
||||
|
|
Loading…
Reference in a new issue