fixing category admin panel integration

This commit is contained in:
Julian Lam
2013-11-26 15:14:12 -05:00
parent 798e17a954
commit 34459e7cf1
7 changed files with 12 additions and 29 deletions

View File

@@ -81,7 +81,8 @@ define(function() {
name: $('#inputName').val(),
description: $('#inputDescription').val(),
icon: $('#new-category-modal i').val(),
blockclass: $('#inputBlockclass').val()
bgColor: '#0059b2',
color: '#fff'
};
socket.emit('api:admin.categories.create', category, function(err, data) {

View File

@@ -135,7 +135,9 @@ define(function() {
categoriesEl.className = 'category-list';
for (x = 0; x < numCategories; x++) {
info = data.categories[x];
categoryEl.className = info.blockclass + (info.disabled === '1' ? ' disabled' : '');
categoryEl.style.background = info.bgColor;
categoryEl.style.color = info.color || '#fff';
categoryEl.className = info.disabled === '1' ? ' disabled' : '';
categoryEl.innerHTML = '<i class="fa ' + info.icon + '"></i> ' + info.name;
categoryEl.setAttribute('data-cid', info.cid);
categoriesFrag.appendChild(categoryEl.cloneNode(true));