mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Clicking on quote button was tricky
This commit is contained in:
parent
193244f8c1
commit
4da4f986ee
@ -1,11 +1,5 @@
|
|||||||
import { selectedText } from 'discourse/lib/utilities';
|
import { selectedText } from 'discourse/lib/utilities';
|
||||||
|
|
||||||
// we don't want to deselect when we click on buttons that use it
|
|
||||||
function willQuote(e) {
|
|
||||||
const $target = $(e.target);
|
|
||||||
return $target.hasClass('quote-button') || $target.closest('.create, .share, .reply-new').length;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
classNames: ['quote-button'],
|
classNames: ['quote-button'],
|
||||||
classNameBindings: ['visible'],
|
classNameBindings: ['visible'],
|
||||||
@ -109,7 +103,7 @@ export default Ember.Component.extend({
|
|||||||
$(document).on("mousedown.quote-button", e => {
|
$(document).on("mousedown.quote-button", e => {
|
||||||
this._isMouseDown = true;
|
this._isMouseDown = true;
|
||||||
this._reselected = false;
|
this._reselected = false;
|
||||||
if (!willQuote(e)) {
|
if ($(e.target).closest('.quote-button, .create, .share, .reply-new').length === 0) {
|
||||||
this._hideButton();
|
this._hideButton();
|
||||||
}
|
}
|
||||||
}).on("mouseup.quote-button", () => {
|
}).on("mouseup.quote-button", () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user