diff --git a/app/assets/javascripts/discourse/components/topic-status.js.es6 b/app/assets/javascripts/discourse/components/topic-status.js.es6 index dd8b0f8c0b8..ef510861b4c 100644 --- a/app/assets/javascripts/discourse/components/topic-status.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-status.js.es6 @@ -6,22 +6,18 @@ export default Ember.Component.extend(StringBuffer, { hasDisplayableStatus: Em.computed.or('topic.archived','topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault', 'topic.is_warning'), rerenderTriggers: ['topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'], - watchClick: function(){ - var self = this; + click: function() { + var topic = this.get('topic'); - this.$('a').click(function(){ - var topic = self.get('topic'); + // only pin unpin for now + if (topic.get('pinned')) { + topic.clearPin(); + } else { + topic.rePin(); + } - // only pin unpin for now - if (topic.get('pinned')) { - topic.clearPin(); - } else { - topic.rePin(); - } - - return false; - }); - }.on('didInsertElement'), + return false; + }, canAct: function() { return Discourse.User.current() && !this.get('disableActions'); diff --git a/app/assets/javascripts/discourse/templates/topic.hbs b/app/assets/javascripts/discourse/templates/topic.hbs index 54f6fad5cac..f724e92ffbd 100644 --- a/app/assets/javascripts/discourse/templates/topic.hbs +++ b/app/assets/javascripts/discourse/templates/topic.hbs @@ -9,7 +9,7 @@