jenkins-bot has submitted this change and it was merged.
Change subject: (bug 56132) Hide hover-over for posts that are being edited
......................................................................
(bug 56132) Hide hover-over for posts that are being edited
Also: Rename $postContainer to $post, since it is a flow-post,
not a flow-post-container.
Change-Id: I6648f0738210ab913ddc15ccb9bd77dd7f176f82
---
M modules/discussion/forms.js
M modules/discussion/styles/post.less
2 files changed, 18 insertions(+), 6 deletions(-)
Approvals:
Matthias Mullie: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/discussion/forms.js b/modules/discussion/forms.js
index 2ee3544..1f05e3d 100644
--- a/modules/discussion/forms.js
+++ b/modules/discussion/forms.js
@@ -127,13 +127,13 @@
$container.find( '.flow-edit-post-link' )
.click( function ( e ) {
e.preventDefault();
- var $postContainer = $( this ).closest( '.flow-post' ),
- $contentContainer = $postContainer.find(
'.flow-post-content' ),
+ var $post = $( this ).closest( '.flow-post' ),
+ $contentContainer = $post.find(
'.flow-post-content' ),
workflowId = $( this ).flow(
'getTopicWorkflowId' ),
pageName = $( this ).closest( '.flow-container'
).data( 'page-title' ),
- postId = $postContainer.data( 'post-id' );
+ postId = $post.data( 'post-id' );
- if ( $postContainer.find( '.flow-edit-post-form'
).length ) {
+ if ( $post.find( '.flow-edit-post-form' ).length ) {
return;
}
@@ -160,7 +160,6 @@
return;
}
-
$contentContainer.flow( 'setupEditForm',
'post',
{
@@ -171,7 +170,7 @@
return
mw.flow.api.editPost( workflowId, postId, content );
}
).done( function ( output ) {
- $postContainer
+ $post
.empty()
.append(
$(
output.rendered )
@@ -179,6 +178,15 @@
.children()
);
} );
+
+ $post.addClass( 'flow-post-nocontrols' );
+
+ $contentContainer.siblings( 'form' )
+ .find( '.flow-cancel-link' )
+ .click( function(e) {
+ $post
+ .removeClass(
'flow-post-nocontrols' );
+ } );
} )
.fail( function () {
var $errorDiv = $( '<div/>' )
diff --git a/modules/discussion/styles/post.less
b/modules/discussion/styles/post.less
index c8041ca..578c29e 100644
--- a/modules/discussion/styles/post.less
+++ b/modules/discussion/styles/post.less
@@ -330,4 +330,8 @@
&.flow-post-highlighted > .flow-post {
border-left: 6px solid #00AF89
}
+
+ .flow-post-nocontrols .flow-post-interaction {
+ display: none;
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/92492
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6648f0738210ab913ddc15ccb9bd77dd7f176f82
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Werdna <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits