mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:57:29 +08:00
Merge pull request #792 from ZogStriP/fix-shift-click-to-select-text-does-not-work-in-topics
FIX: Shift+Click to select text does not work in topics
This commit is contained in:
commit
fc56e51cc6
|
@ -45,7 +45,10 @@ Discourse.QuoteButtonController = Discourse.Controller.extend({
|
|||
|
||||
// don't display the "quote reply" button if you select text spanning two posts
|
||||
// note: the ".contents" is here to prevent selection of the topic summary
|
||||
if ($ancestor.closest('.topic-body > .contents').length === 0) return;
|
||||
if ($ancestor.closest('.topic-body > .contents').length === 0) {
|
||||
this.set('buffer', '');
|
||||
return;
|
||||
}
|
||||
|
||||
var selectedText = Discourse.Utilities.selectedText();
|
||||
if (this.get('buffer') === selectedText) return;
|
||||
|
|
|
@ -49,7 +49,8 @@ Discourse.QuoteButtonView = Discourse.View.extend({
|
|||
view.set('isMouseDown', true);
|
||||
if ($(e.target).hasClass('quote-button') || $(e.target).hasClass('create')) return;
|
||||
// deselects only when the user left-click
|
||||
if (e.which === 1) controller.deselectText();
|
||||
// this also allow anyone to `extend` their selection using a shift+click
|
||||
if (e.which === 1 && !e.shiftKey) controller.deselectText();
|
||||
})
|
||||
.on('mouseup.quote-button', function(e) {
|
||||
view.selectText(e.target, controller);
|
||||
|
|
Loading…
Reference in New Issue
Block a user