瀏覽代碼

finish adding[4~ copyMany

Erik Turk 7 年之前
父節點
當前提交
257ed56db3
共有 2 個文件被更改,包括 13 次插入6 次删除
  1. 0 3
      client/components/cards/cardDetails.jade
  2. 13 3
      client/components/cards/cardDetails.js

+ 0 - 3
client/components/cards/cardDetails.jade

@@ -165,9 +165,6 @@ template(name="copyManyCardPopup")
   else
     +boardsAndLists
 
-template(name="boardsAndLists")
-
-
 template(name="boardsAndLists")
   select.js-select-boards
     each boards

+ 13 - 3
client/components/cards/cardDetails.js

@@ -313,10 +313,20 @@ Template.copyManyCardPopup.events({
 
     if (titleEntry) {
       var title, titleList;
+      console.log(titleEntry);
+      console.log(titleEntry.length);
+      var titleList = JSON.parse(titleEntry);
+      console.log(titleList);
+      console.log(titleList[0]);
+      console.log(titleList[0].title);
+	
       
-      for (let title of titleList.split(",")) {
+      for (var i = 0; i < titleList.length; i++){
+	      var obj = titleList[i];
+              console.log(obj.title);
 
-	      card.title = title;
+	      card.title = obj.title;
+	      card.description = obj.description;
 	      card.coverId = '';
 	      const _id = Cards.insert(card);
 // In case the filter is active we need to add the newly inserted card in
@@ -344,9 +354,9 @@ Template.copyManyCardPopup.events({
 		comment._id = null;
 		CardComments.insert(comment);
 	      });
+	}
       Popup.close();
     }
-    }
   },
 });