Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/2f1b85f335aa88de061153eb24193828 to your computer and use it in GitHub Desktop.
Save iaindooley/2f1b85f335aa88de061153eb24193828 to your computer and use it in GitHub Desktop.
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