Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active May 7, 2020 12:17
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/a440a6a91b68676f489a0b64652b95ac to your computer and use it in GitHub Desktop.
Save iaindooley/a440a6a91b68676f489a0b64652b95ac to your computer and use it in GitHub Desktop.
Update list counts
function updateListCounts(notification)
{
var notif = new Notification(notification);
var added = notif.addedCard();
if(parts = /(.+) \(([0-9]+)\)/.exec(notif.listAfter().name()))
{
notif.listAfter().setName(parts[1]+" ("+notif.listAfter().countCards()+")");
if(parts = /(.+) \(([0-9]+)\)/.exec(notif.listBefore().name()))
{
notif.listBefore().setName(parts[1]+" ("+notif.listBefore().countCards()+")");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment