Skip to content

Instantly share code, notes, and snippets.

@CaitW
Created October 2, 2015 14:53
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 CaitW/f13f23b2edd35fb16b5c to your computer and use it in GitHub Desktop.
Save CaitW/f13f23b2edd35fb16b5c to your computer and use it in GitHub Desktop.
Sort GitHub Labels by Color
var colorObject = {};
$(".label-link").each(function (index) {
var color = $(this).css("background-color");
if(typeof colorObject[color] == "undefined")
{
colorObject[color] = [];
}
colorObject[color].push($(this).parent().parent());
});
$(".labels-list ul.table-list>li").detach();
$.each(colorObject, function (key, labelArray) {
$.each(labelArray, function (index, label) {
$(".labels-list ul.table-list").append(label);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment