Created
October 21, 2016 01:01
-
-
Save acoppes/a16ae220fcea83d6090ca6f8ad9a1a41 to your computer and use it in GitHub Desktop.
patch to fix bug on Progress for trello plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/bp-trello.js b/js/bp-trello.js | |
index 56612ad..c8d12ec 100644 | |
--- a/js/bp-trello.js | |
+++ b/js/bp-trello.js | |
@@ -347,8 +347,16 @@ UPDATED | |
//reset | |
bp.math.progressMax = 0; | |
bp.math.progressComplete = 0; | |
- _lists = ModelCacheCache._caches['board_'+getBoard().id]._cache.List; | |
- _cards = ModelCacheCache._caches['board_'+getBoard().id]._cache.Card; | |
+ | |
+ var boardId = 'board_'+getBoard().id; | |
+ | |
+ // global.boardView.model = window.ModelCache._cache.Card[1].getBoard() | |
+ | |
+ _lists = window.ModelCache._cache.List; | |
+ _cards = window.ModelCache._cache.Card; | |
+ | |
+ // _lists = window.ModelCache._caches[boardId]._cache.List; | |
+ // _cards = window.ModelCache._caches[boardId]._cache.Card; | |
//try updating the drop down. If there are no lists, try again (with buffer). | |
if(!updateDoneOptions(_lists)){ setTimeout(loadData,100); return; } | |
@@ -364,6 +372,8 @@ UPDATED | |
if(_cards[cardID].attributes.closed){ continue; } //skip if the card is closed | |
if(_cards[cardID].attributes.idList != listID){ continue; } //skip if the card doesn't belong to this list | |
+ var currentCard = _cards[cardID]; | |
+ | |
//track card worth and location | |
var inComplete = false, toComplete = 0, toMax = 0; | |
@@ -374,8 +384,11 @@ UPDATED | |
//count checklists? | |
if(bp.user.countCheckLists){ | |
//loop through each checklist for this card | |
- for(var i = 0, ii = _cards[cardID].checklistList.length; i < ii; i++){ | |
- var checklistItems = _cards[cardID].checklistList.models[i].attributes.checkItems; //cache | |
+ for(var i = 0, ii = currentCard.checklistList.length; i < ii; i++){ | |
+ var checklistItems = currentCard.checklistList.models[i].attributes.checkItems; //cache | |
+ | |
+ if (!checklistItems) | |
+ continue; | |
//count items toComplete? | |
if(bp.user.countCheckListsTowardsComplete){ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment