From f71f7d166cd6d6ba5772ae51b91da76372b191b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 2 May 2013 02:22:31 +0200 Subject: [PATCH] FIX: when topic is closed, you can still invite someone to reply --- .../discourse/views/topic_footer_buttons_view.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js b/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js index edeb5c39d..b3cca6649 100755 --- a/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js +++ b/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js @@ -24,9 +24,14 @@ Discourse.TopicFooterButtonsView = Ember.ContainerView.extend({ // We hide some controls from private messages if (this.get('topic.can_invite_to')) { - this.addObject(Discourse.ButtonView.create({ + this.addObject(Discourse.ButtonView.createWithMixins({ textKey: 'topic.invite_reply.title', helpKey: 'topic.invite_reply.help', + attributeBindings: ['disabled'], + + disabled: function(){ + return this.get('controller.content.archived') || this.get('controller.content.closed'); + }.property('controller.content.archived', 'controller.content.closed'), renderIcon: function(buffer) { buffer.push("");