瀏覽代碼

Fixes #2638 importing trello

Justin Reynolds 5 年之前
父節點
當前提交
9d8a38f324
共有 2 個文件被更改,包括 11 次插入13 次删除
  1. 10 12
      client/components/import/import.js
  2. 1 1
      client/lib/popup.js

+ 10 - 12
client/components/import/import.js

@@ -211,22 +211,20 @@ BlazeComponent.extendComponent({
     this.parentComponent().nextStep();
   },
 
-  onMapMember(evt) {
-    const memberToMap = this.currentData();
-    if (memberToMap.wekan) {
-      // todo xxx ask for confirmation?
-      this.unmapMember(memberToMap.id);
-    } else {
-      this.setSelectedMember(memberToMap.id);
-      Popup.open('importMapMembersAdd')(evt);
-    }
-  },
-
   events() {
     return [
       {
         submit: this.onSubmit,
-        'click .js-select-member': this.onMapMember,
+        'click .js-select-member'(evt) {
+          const memberToMap = this.currentData();
+          if (memberToMap.wekan) {
+            // todo xxx ask for confirmation?
+            this.unmapMember(memberToMap.id);
+          } else {
+            this.setSelectedMember(memberToMap.id);
+            Popup.open('importMapMembersAdd')(evt);
+          }
+        },
       },
     ];
   },

+ 1 - 1
client/lib/popup.js

@@ -67,7 +67,7 @@ window.Popup = new (class {
         title: self._getTitle(popupName),
         depth: self._stack.length,
         offset: self._getOffset(openerElement),
-        dataContext: (this.currentData && this.currentData()) || this,
+        dataContext: (this && this.currentData && this.currentData()) || this,
       });
 
       // If there are no popup currently opened we use the Blaze API to render