label with colors in filter

This commit is contained in:
Ezequiel Bergamaschi 2014-01-28 01:17:49 -03:00 committed by Ezequiel Bergamaschi
parent acb3782561
commit b19ac2c4c3
2 changed files with 38 additions and 1 deletions

View File

@ -102,6 +102,36 @@ input#selectAll {
display: none;
}
/* ---------------------------- Label --------------------------------- */
.labelColor {
width: 12px;
height: 12px;
display: inline-block;
position: relative;
left: 2px;
top: 1px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.labelName {
display: inline-block;
position: relative;
left: 7px;
}
.labelTag {
border: 1px solid;
border-radius: 3px;
color: white;
display: inline-block;
font-size: 11px;
line-height: 1;
padding: 2px 5px 1px 5px;
}
/* ---------------------------- Sorting --------------------------------- */
.sorting_asc {

View File

@ -1,9 +1,16 @@
function createLabelItem(data) {
if (data.color == "") {
data.color = "#000000";
}
$("#foldersContainer").find("ul").append(
$("<li data-filter=\"" + data.title + "\">").append(
"<a href=\"#\"> <i class=\"icon-tag\"></i>" + data.title + "</a>"
"<a href=\"#\"> <i class=\"icon-tag\"></i>" +
"<div class='labelColor' style='background: " + data.color + "'></div>" +
"<div class='labelName'>" + data.title + "</div>" +
"</a>"
)
)
}
function fetchLabels() {