FIX: allows invite modal from topic-map post-actions (#7047)

This commit is contained in:
Joffrey JAFFEUX 2019-02-21 13:48:03 +01:00 committed by GitHub
parent e69634ec3a
commit 8d779db270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 2 deletions

View File

@ -45,7 +45,6 @@ export default {
}
showModal("share-and-invite", {
model: this.get("topic"),
modalClass: "share-and-invite",
panels
});

View File

@ -48,6 +48,31 @@ const TopicRoute = Discourse.Route.extend({
},
actions: {
showInvite() {
let invitePanelTitle;
if (this.get("isPM")) {
invitePanelTitle = "topic.invite_private.title";
} else if (this.get("invitingToTopic")) {
invitePanelTitle = "topic.invite_reply.title";
} else {
invitePanelTitle = "user.invited.create";
}
showModal("share-and-invite", {
modalClass: "share-and-invite",
panels: [
{
id: "invite",
title: invitePanelTitle,
model: {
inviteModel: this.modelFor("topic")
}
}
]
});
},
showFlags(model) {
let controller = showModal("flag", { model });
controller.setProperties({ flagTopic: false });

View File

@ -200,7 +200,8 @@
selectReplies=(action "selectReplies")
selectBelow=(action "selectBelow")
fillGapBefore=(action "fillGapBefore")
fillGapAfter=(action "fillGapAfter")}}
fillGapAfter=(action "fillGapAfter")
showInvite=(route-action "showInvite")}}
{{/unless}}
{{conditional-loading-spinner condition=model.postStream.loadingBelow}}