Last active
October 14, 2015 13:52
-
-
Save robinwarren/80f34a018032d482949e to your computer and use it in GitHub Desktop.
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
//Called when we have loaded the labels for a board | |
var loadedLabels = function(labels) { | |
$.each(labels, function(index, label) { | |
var label = $("<p><span class='badge' style='background:" + label.color + ";'>" + label.uses + "</span> " + label.name + "</p>"); | |
$('#labels').append(label) | |
}); | |
}; | |
//Listen to changes to the boards selector | |
$('#boards').change(function() { | |
var boardId = $("option:selected", this).val(); | |
$('#labels').empty(); | |
Trello.get( | |
'/boards/' + boardId + '/labels', | |
loadedLabels, | |
function() { console.log("Failed to load labels"); } | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment