Created
June 28, 2019 08:43
-
-
Save iaindooley/2f1b85f335aa88de061153eb24193828 to your computer and use it in GitHub Desktop.
List counts
This file contains 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
function countArchivedCard(notification) | |
{ | |
updateCountForList(new Notification(notification).archivedCard().currentList()); | |
} | |
function countMovedCard(notification) | |
{ | |
var notif = new Notification(notification); | |
notif.movedCard(); | |
updateCountForList(notif.listBefore()); | |
updateCountForList(notif.listAfter()); | |
} | |
function countCreatedCard(notification) | |
{ | |
updateCountForList(new Notification(notification).createdCard().currentList()); | |
} | |
function updateCountForList(list) | |
{ | |
list.setName(/(.+) \([0-9]+\)/.exec(list.name()[1]+" ("+list.countCards()+")"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment