diff --git a/app/assets/javascripts/discourse/views/post_view.js b/app/assets/javascripts/discourse/views/post_view.js index 62cd2aa1a33..f316af35ef6 100644 --- a/app/assets/javascripts/discourse/views/post_view.js +++ b/app/assets/javascripts/discourse/views/post_view.js @@ -108,7 +108,16 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, { }, _toggleQuote: function($aside) { + if (this.get('expanding')) { return; } + this.set('expanding', true); + $aside.data('expanded', !$aside.data('expanded')); + + var self = this, + finished = function() { + self.set('expanding', false); + }; + if ($aside.data('expanded')) { this._updateQuoteElements($aside, 'chevron-up'); // Show expanded quote @@ -128,12 +137,12 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, { Discourse.ajax("/posts/by_number/" + topicId + "/" + postId).then(function (result) { var parsed = $(result.cooked); parsed.replaceText(originalText, "" + originalText + ""); - $blockQuote.showHtml(parsed); + $blockQuote.showHtml(parsed, 'fast', finished); }); } else { // Hide expanded quote this._updateQuoteElements($aside, 'chevron-down'); - $('blockquote', $aside).showHtml($aside.data('original-contents')); + $('blockquote', $aside).showHtml($aside.data('original-contents'), 'fast', finished); } return false; },