Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List counts
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