mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
BUGFIX: clicking on home was broke
This commit is contained in:
parent
6daef624c3
commit
cd8b30bfcb
1 changed files with 7 additions and 6 deletions
|
@ -13,14 +13,15 @@ Discourse.TopicStatusComponent = Ember.Component.extend({
|
|||
shouldRerender: Discourse.View.renderIfChanged('topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned'),
|
||||
|
||||
didInsertElement: function(){
|
||||
var topic = this.get('topic');
|
||||
|
||||
// could be passed in a controller
|
||||
if(topic.constructor.toString() !== 'Discourse.Topic') {
|
||||
topic = topic.get('model');
|
||||
}
|
||||
var self = this;
|
||||
|
||||
this.$('a').click(function(){
|
||||
var topic = self.get('topic');
|
||||
|
||||
// could be passed in a controller
|
||||
if(topic.constructor && topic.constructor.toString() !== 'Discourse.Topic') {
|
||||
topic = topic.get('model');
|
||||
}
|
||||
// only pin unpin for now
|
||||
if (topic.get('pinned')) {
|
||||
topic.clearPin();
|
||||
|
|
Loading…
Reference in a new issue