competitions are now colored in the same way as on digitalrock.de

This commit is contained in:
Dorian Zedler 2019-05-14 18:19:14 +02:00
parent e92a757ccd
commit 1c0e6aaca8

View file

@ -179,6 +179,18 @@ Page {
return true return true
} }
function getCompCatData(compCatId) {
var obj = app.compCats
for(var prop in obj) {
// go through the whole array and search for data keys
if (obj.hasOwnProperty(prop) && obj[prop]["cat_id"].indexOf(compCatId) >= 0) {
console.log("found cat: " + obj[prop]['label'])
return obj[prop]
}
}
}
DataListView { DataListView {
id: calendarList id: calendarList
@ -230,7 +242,7 @@ Page {
property string name: calendarList.listData[index]["name"] property string name: calendarList.listData[index]["name"]
property string date: calendarList.listData[index]["date_span"] property string date: calendarList.listData[index]["date_span"]
property var cats: calendarList.listData[index]["cats"] property var cats: calendarList.listData[index]["cats"]
property int catId: calendarList.listData[index]["cat_id"] property int catId: calendarList.listData[index]["cat_id"] === undefined ? 0:calendarList.listData[index]["cat_id"]
property bool over property bool over
property var thisData: calendarList.listData[index] property var thisData: calendarList.listData[index]
@ -263,7 +275,7 @@ Page {
opacity: 0.5 opacity: 0.5
color: app.competitionCategoryColors[catId] color: root.getCompCatData(catId) === undefined ? "white":root.getCompCatData(catId)["bgcolor"]
} }
Column { Column {