Werdna has uploaded a new change for review.
https://gerrit.wikimedia.org/r/104910
Change subject: When executing an action on a post, just replace the
.flow-post, not the whole .flow-post-container.
......................................................................
When executing an action on a post, just replace the .flow-post,
not the whole .flow-post-container.
Bug: 58747
Change-Id: I724a0358d60e458337a8dac32469007ee5d806d8
---
M modules/discussion/forms.js
M modules/moderation/moderation.js
2 files changed, 13 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/10/104910/1
diff --git a/modules/discussion/forms.js b/modules/discussion/forms.js
index 2e3115f..4e194f9 100644
--- a/modules/discussion/forms.js
+++ b/modules/discussion/forms.js
@@ -159,8 +159,8 @@
}
).done( function ( output ) {
var $content = $(
output.rendered );
- $post.closest(
'.flow-post-container' )
- .replaceWith( $content
);
+ $post.closest( '.flow-post' )
+ .replaceWith(
$content.find( '.flow-post' ) );
$content
.trigger( 'flow_init' );
} );
diff --git a/modules/moderation/moderation.js b/modules/moderation/moderation.js
index c867b21..37f5c44 100644
--- a/modules/moderation/moderation.js
+++ b/modules/moderation/moderation.js
@@ -70,7 +70,8 @@
function( promise ) {
promise.done(
function( output ) {
var confirmationMsg,
-
$newContainer = $( output.rendered );
+
$renderedReplacement = $( output.rendered ),
+
$newContainer;
// Messages used here:
// flow-moderation-confirmation-suppress-post
@@ -94,7 +95,15 @@
) )
);
-
$resultContainer.replaceWith( $newContainer );
+
if ( targetType === 'post' ) {
+
$newContainer = $renderedReplacement.find( '.flow-post' );
+
$postContainer.children( '.flow-post' )
+
.replaceWith( $newContainer );
+
} else if ( targetType === 'topic' ) {
+
$newContainer = $renderedReplacement;
+
$topicContainer.replaceWith( $newContainer );
+
}
+
$newContainer.trigger( 'flow_init' );
} )
.fail(
function() {
--
To view, visit https://gerrit.wikimedia.org/r/104910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I724a0358d60e458337a8dac32469007ee5d806d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits