Remove reliance on views for logic, move to controller

This commit is contained in:
Robin Ward
2013-07-11 16:55:07 -04:00
parent 19c169540c
commit bb5a9aa34b
3 changed files with 13 additions and 13 deletions
@@ -254,6 +254,17 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
this.get('content').destroy(Discourse.User.current());
},
resetRead: function() {
Discourse.ScreenTrack.instance().reset();
this.unsubscribe();
var topicController = this;
this.get('model').resetRead().then(function() {
topicController.set('message', I18n.t("topic.read_position_reset"));
topicController.set('postStream.loaded', false);
});
},
toggleVisibility: function() {
this.get('content').toggleStatus('visible');
},