Переглянути джерело

Fixed label popup at desktop view (add and remove labels)

Fixes: #4156
Martin Filser 3 роки тому
батько
коміт
37faa41d97
2 змінених файлів з 3 додано та 1 видалено
  1. 1 1
      client/components/cards/labels.js
  2. 2 0
      models/cards.js

+ 1 - 1
client/components/cards/labels.js

@@ -78,7 +78,7 @@ BlazeComponent.extendComponent({
     return [
       {
         'click .js-select-label'(event) {
-          const card = Utils.getCurrentCard();
+          const card = this.data();
           const labelId = this.currentData()._id;
           card.toggleLabel(labelId);
           event.preventDefault();

+ 2 - 0
models/cards.js

@@ -2016,6 +2016,7 @@ Cards.mutations({
   },
 
   addLabel(labelId) {
+    this.labelIds.push(labelId);
     return {
       $addToSet: {
         labelIds: labelId,
@@ -2024,6 +2025,7 @@ Cards.mutations({
   },
 
   removeLabel(labelId) {
+    this.labelIds = _.without(this.labelIds, labelId);
     return {
       $pull: {
         labelIds: labelId,