From c77a20eea5aa4758e21ebfb12adfa7dd58f37b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Sun, 27 Oct 2013 19:44:46 +0100 Subject: [PATCH] do not deselect text when clicking on the reply button below the post --- app/assets/javascripts/discourse/views/quote_button_view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/views/quote_button_view.js b/app/assets/javascripts/discourse/views/quote_button_view.js index e85f5ac7d10..9c6d02949dc 100644 --- a/app/assets/javascripts/discourse/views/quote_button_view.js +++ b/app/assets/javascripts/discourse/views/quote_button_view.js @@ -46,7 +46,8 @@ Discourse.QuoteButtonView = Discourse.View.extend({ $(document) .on("mousedown.quote-button", function(e) { view.set('isMouseDown', true); - if ($(e.target).hasClass('quote-button') || $(e.target).hasClass('create')) return; + // we don't want to deselect when we click on the quote button or the reply button + if ($(e.target).hasClass('quote-button') || $(e.target).closest('.create').length > 0) return; // deselects only when the user left click // (allows anyone to `extend` their selection using shift+click) if (e.which === 1 && !e.shiftKey) controller.deselectText();