From 1308dbbef7a3dcceb7aafd138dfa9eec78af992c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 2 Jul 2013 13:36:38 -0400 Subject: [PATCH] FIX: Quote popup broke in refactor --- .../discourse/controllers/quote_button_controller.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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