mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Merge pull request #621 from ZogStriP/fix-some-quote-reply-button-quirks
Fix some 'quote reply' button quirks
This commit is contained in:
commit
9bb950ab37
2 changed files with 12 additions and 1 deletions
|
@ -64,7 +64,10 @@ Discourse.QuoteButtonController = Discourse.Controller.extend({
|
||||||
|
|
||||||
// move the quote button at the beginning of the selection
|
// move the quote button at the beginning of the selection
|
||||||
var $quoteButton = $('.quote-button');
|
var $quoteButton = $('.quote-button');
|
||||||
$quoteButton.css({ top: top - $quoteButton.outerHeight(), left: left });
|
$quoteButton.css({
|
||||||
|
top: top - $quoteButton.outerHeight() - 5,
|
||||||
|
left: left
|
||||||
|
});
|
||||||
|
|
||||||
// remove the marker
|
// remove the marker
|
||||||
markerElement.parentNode.removeChild(markerElement);
|
markerElement.parentNode.removeChild(markerElement);
|
||||||
|
|
|
@ -43,6 +43,10 @@ Discourse.PostView = Discourse.View.extend({
|
||||||
this.set('context', this.get('content'));
|
this.set('context', this.get('content'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mouseDown: function(e) {
|
||||||
|
this.set('isMouseDown', true);
|
||||||
|
},
|
||||||
|
|
||||||
mouseUp: function(e) {
|
mouseUp: function(e) {
|
||||||
if (this.get('controller.multiSelect') && (e.metaKey || e.ctrlKey)) {
|
if (this.get('controller.multiSelect') && (e.metaKey || e.ctrlKey)) {
|
||||||
this.toggleProperty('post.selected');
|
this.toggleProperty('post.selected');
|
||||||
|
@ -56,6 +60,8 @@ Discourse.PostView = Discourse.View.extend({
|
||||||
e.context = this.get('post');
|
e.context = this.get('post');
|
||||||
qbc.selectText(e);
|
qbc.selectText(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.set('isMouseDown', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
selectText: (function() {
|
selectText: (function() {
|
||||||
|
@ -260,6 +266,8 @@ Discourse.PostView = Discourse.View.extend({
|
||||||
$(document).on('selectionchange', function(e) {
|
$(document).on('selectionchange', function(e) {
|
||||||
// quoting as been disabled by the user
|
// quoting as been disabled by the user
|
||||||
if (!Discourse.get('currentUser.enable_quoting')) return;
|
if (!Discourse.get('currentUser.enable_quoting')) return;
|
||||||
|
// there is no need to handle this event when the mouse is down
|
||||||
|
if (postView.get('isMouseDown')) return;
|
||||||
// find out whether we currently are selecting inside a post
|
// find out whether we currently are selecting inside a post
|
||||||
var closestPosts = $(window.getSelection().anchorNode).closest('.topic-post');
|
var closestPosts = $(window.getSelection().anchorNode).closest('.topic-post');
|
||||||
if (closestPosts.length === 0) return;
|
if (closestPosts.length === 0) return;
|
||||||
|
|
Loading…
Reference in a new issue