diff --git a/app/assets/javascripts/discourse/controllers/quote_button_controller.js b/app/assets/javascripts/discourse/controllers/quote_button_controller.js index bfd4e2e38b7..36ce6e12590 100644 --- a/app/assets/javascripts/discourse/controllers/quote_button_controller.js +++ b/app/assets/javascripts/discourse/controllers/quote_button_controller.js @@ -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