Created
October 2, 2015 14:53
-
-
Save CaitW/f13f23b2edd35fb16b5c to your computer and use it in GitHub Desktop.
Sort GitHub Labels by Color
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
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