do not deselect text when clicking on the reply button below the post

This commit is contained in:
Régis Hanol 2013-10-27 19:44:46 +01:00
parent ce2af5c6d1
commit c77a20eea5

View File

@ -46,7 +46,8 @@ Discourse.QuoteButtonView = Discourse.View.extend({
$(document) $(document)
.on("mousedown.quote-button", function(e) { .on("mousedown.quote-button", function(e) {
view.set('isMouseDown', true); 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 // deselects only when the user left click
// (allows anyone to `extend` their selection using shift+click) // (allows anyone to `extend` their selection using shift+click)
if (e.which === 1 && !e.shiftKey) controller.deselectText(); if (e.which === 1 && !e.shiftKey) controller.deselectText();