From ab2a1ae9b972a6a2710e9e9396bd6f99419a4dbe Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 21 Nov 2013 00:21:01 +0000 Subject: [PATCH] Accept categories as objects in an array as well as map by category ID --- etemplate/js/et2_extension_nextmatch_rowProvider.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch_rowProvider.js b/etemplate/js/et2_extension_nextmatch_rowProvider.js index 20792682ca..c1bc40c69d 100644 --- a/etemplate/js/et2_extension_nextmatch_rowProvider.js +++ b/etemplate/js/et2_extension_nextmatch_rowProvider.js @@ -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; }