mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: makes composer-actions toggling whisper instead of replying
This commit is contained in:
parent
0156ae486d
commit
f7df68c9a3
4 changed files with 19 additions and 52 deletions
|
@ -28,8 +28,8 @@ export default DropdownSelectBoxComponent.extend({
|
|||
return content;
|
||||
},
|
||||
|
||||
@computed("options", "canWhisper", "whispering", "composerModel.post.username")
|
||||
content(options, canWhisper, whispering, postUsername) {
|
||||
@computed("options", "canWhisper", "composerModel.post.username")
|
||||
content(options, canWhisper, postUsername) {
|
||||
let items = [
|
||||
{
|
||||
name: I18n.t("composer.composer_actions.reply_as_new_topic.label"),
|
||||
|
@ -58,21 +58,12 @@ export default DropdownSelectBoxComponent.extend({
|
|||
}
|
||||
|
||||
if (canWhisper) {
|
||||
if (whispering) {
|
||||
items.push({
|
||||
name: I18n.t("composer.composer_actions.reply_as_not_whisper.label"),
|
||||
description: I18n.t("composer.composer_actions.reply_as_not_whisper.desc"),
|
||||
icon: "eye",
|
||||
id: "reply_as_not_whisper"
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
name: I18n.t("composer.composer_actions.reply_as_whisper.label"),
|
||||
description: I18n.t("composer.composer_actions.reply_as_whisper.desc"),
|
||||
icon: "eye-slash",
|
||||
id: "reply_as_whisper"
|
||||
});
|
||||
}
|
||||
items.push({
|
||||
name: I18n.t("composer.composer_actions.toggle_whisper.label"),
|
||||
description: I18n.t("composer.composer_actions.toggle_whisper.desc"),
|
||||
icon: "eye-slash",
|
||||
id: "toggle_whisper"
|
||||
});
|
||||
}
|
||||
|
||||
return items;
|
||||
|
@ -92,14 +83,8 @@ export default DropdownSelectBoxComponent.extend({
|
|||
actions: {
|
||||
onSelect(value) {
|
||||
switch(value) {
|
||||
case "reply_as_whisper":
|
||||
this.set("composerModel.whisper", true);
|
||||
this.get("composerController").save();
|
||||
break;
|
||||
|
||||
case "reply_as_not_whisper":
|
||||
this.set("composerModel.whisper", false);
|
||||
this.get("composerController").save();
|
||||
case "toggle_whisper":
|
||||
this.set("composerModel.whisper", !this.get("composerModel.whisper"));
|
||||
break;
|
||||
|
||||
case "reply_to_topic":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue