summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
authorJustin Reynolds <justinr1234@gmail.com>2019-09-06 17:18:06 -0500
committerJustin Reynolds <justinr1234@gmail.com>2019-09-06 17:18:06 -0500
commit74b5bdf2aa66a2b4ea94d4ecbd7f5f63eaf1f5eb (patch)
treef9f6171c3178269404f8fa7cac3c752a2b641a00 /client/components/cards
parent2c78aab3dc91ee276bfb5e4717ada72dc84ca3b0 (diff)
downloadwekan-74b5bdf2aa66a2b4ea94d4ecbd7f5f63eaf1f5eb.tar.gz
wekan-74b5bdf2aa66a2b4ea94d4ecbd7f5f63eaf1f5eb.tar.bz2
wekan-74b5bdf2aa66a2b4ea94d4ecbd7f5f63eaf1f5eb.zip
Fix #2451 unable to drag select text without closing card details
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/cardDetails.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index cd8813f5..47941560 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -321,6 +321,19 @@ BlazeComponent.extendComponent({
parentComponent.showOverlay.set(true);
parentComponent.mouseHasEnterCardDetails = true;
},
+ 'mousedown .js-card-details'() {
+ Session.set('cardDetailsIsDragging', false);
+ Session.set('cardDetailsIsMouseDown', true);
+ },
+ 'mousemove .js-card-details'() {
+ if (Session.get('cardDetailsIsMouseDown')) {
+ Session.set('cardDetailsIsDragging', true);
+ }
+ },
+ 'mouseup .js-card-details'() {
+ Session.set('cardDetailsIsDragging', false);
+ Session.set('cardDetailsIsMouseDown', false);
+ },
'click #toggleButton'() {
Meteor.call('toggleSystemMessages');
},
@@ -777,7 +790,14 @@ BlazeComponent.extendComponent({
EscapeActions.register(
'detailsPane',
() => {
- Utils.goBoardId(Session.get('currentBoard'));
+ if (Session.get('cardDetailsIsDragging')) {
+ // Reset dragging status as the mouse landed outside the cardDetails template area and this will prevent a mousedown event from firing
+ Session.set('cardDetailsIsDragging', false);
+ Session.set('cardDetailsIsMouseDown', false);
+ } else {
+ // Prevent close card when the user is selecting text and moves the mouse cursor outside the card detail area
+ Utils.goBoardId(Session.get('currentBoard'));
+ }
},
() => {
return !Session.equals('currentCard', null);