mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
FIX: Shift+Click to select text does not work in topics
This commit is contained in:
parent
50349e84fe
commit
52bad538a1
2 changed files with 6 additions and 2 deletions
|
@ -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 a new issue