Accept categories as objects in an array as well as map by category ID

This commit is contained in:
Nathan Gray 2013-11-21 00:21:01 +00:00
parent 8c8f7ccbfd
commit ab2a1ae9b9

View File

@ -493,10 +493,17 @@ var et2_nextmatch_rowProvider = Class.extend(
// Check for existing class
// TODO
// Create class
if(this.categories && this.categories[cat_id] && this.categories[cat_id].color)
var cat = this.categories[cat_id] || null;
for(var i = 0; cat == null && this.categories && i < this.categories.length; i++)
{
if(this.categories[i] && this.categories[i].value && this.categories[i].value == cat_id)
{
cat = this.categories[i];
}
}
// Create class
if(cat && cat.color)
{
var cat = this.categories[cat_id];
this._rootWidget.egw().css('.'+cat_class, "background-color: " + cat.color + ";");
classes += ' '+cat_class;
}