FIX: Quote popup broke in refactor

This commit is contained in:
Robin Ward 2013-07-02 13:36:38 -04:00
parent a04924deea
commit 1308dbbef7

View File

@ -55,15 +55,9 @@ Discourse.QuoteButtonController = Discourse.Controller.extend({
if (this.get('buffer') === selectedText) return;
// we need to retrieve the post data from the posts collection in the topic controller
var posts = this.get('controllers.topic.posts'),
length = posts.length,
post;
for (var p = 0; p < length; p++) {
if (posts[p].id === postId) { post = posts[p]; break; }
}
this.set('post', post);
var postStream = this.get('controllers.topic.postStream');
this.set('post', postStream.findLoadedPost(postId));
this.set('buffer', selectedText);
// collapse the range at the beginning of the selection