Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
this._close();
},

composePM(user) {
composePM(user, post) {
this._close();
this.composePrivateMessage(user, this.topic);
this.composePrivateMessage(user, post);
},

cancelFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default Mixin.create({
}

const closestArticle = target.closest("article");
const postId = closestArticle ? closestArticle.dataset["post-id"] : null;
const postId = closestArticle ? closestArticle.dataset.postId : null;
const wasVisible = this.visible;
const previousTarget = this.cardTarget;

Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/discourse/app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
});
},

composePrivateMessage(user, topic) {
composePrivateMessage(user, post) {
const recipients = user ? user.get("username") : "";
const reply = topic
? `${window.location.protocol}//${window.location.host}${topic.url}`
const reply = post
? `${window.location.protocol}//${window.location.host}${post.url}`
: null;
const title = topic
const title = post
? I18n.t("composer.reference_topic_title", {
title: topic.title,
title: post.topic.title,
})
: null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<li class="compose-pm">
{{d-button
class="btn-primary"
action=(action "composePM" this.user)
action=(action "composePM" this.user this.post)
icon="envelope"
label="user.private_message"}}
</li>
Expand Down