Reply button at bottom of topic doesn't ask you to abandon your post when you click it more than once

This commit is contained in:
Neil Lalonde 2013-05-03 12:13:34 -04:00
parent cc60343d31
commit 3c322e6d3d
1 changed files with 13 additions and 6 deletions

View File

@ -135,12 +135,19 @@ Discourse.TopicController = Discourse.ObjectController.extend({
// Topic related
reply: function() {
this.get('controllers.composer').open({
var composerController = this.get('controllers.composer');
if (composerController.get('content.topic.id') === this.get('content.id') &&
composerController.get('content.action') === Discourse.Composer.REPLY) {
composerController.set('content.post', null);
composerController.set('content.composeState', Discourse.Composer.OPEN);
} else {
composerController.open({
topic: this.get('content'),
action: Discourse.Composer.REPLY,
draftKey: this.get('content.draft_key'),
draftSequence: this.get('content.draft_sequence')
});
}
},
toggleParticipant: function(user) {