mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-31 19:22:14 +01:00
Implement data widget property
Fixes missing priority colors in Kanban
This commit is contained in:
parent
bfc9588739
commit
b31ce0922d
@ -186,6 +186,15 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
|
|||||||
align: {
|
align: {
|
||||||
type: String,
|
type: String,
|
||||||
reflect: true
|
reflect: true
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* comma-separated name:value pairs set as data attributes on DOM node
|
||||||
|
* data="mime:${row}[mime]" would generate data-mime="..." in DOM, eg. to use it in CSS on a parent
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
type: String,
|
||||||
|
reflect: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -371,6 +380,40 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
|
|||||||
return this._widget_id;
|
return this._widget_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the dataset from a CSV
|
||||||
|
* @param {string} value
|
||||||
|
*/
|
||||||
|
set data(value : string)
|
||||||
|
{
|
||||||
|
// Clear existing
|
||||||
|
Object.keys(this.dataset).forEach(dataKey =>
|
||||||
|
{
|
||||||
|
delete this.dataset[dataKey];
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = value.split(",");
|
||||||
|
data.forEach((field) =>
|
||||||
|
{
|
||||||
|
let f = field.split(":");
|
||||||
|
if(f[0] && typeof f[1] !== "undefined")
|
||||||
|
{
|
||||||
|
this.dataset[f[0]] = f[1];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
get data() : string
|
||||||
|
{
|
||||||
|
let data = [];
|
||||||
|
Object.keys(this.dataset).forEach((k) =>
|
||||||
|
{
|
||||||
|
data.push(k + ":" + this.dataset[k]);
|
||||||
|
})
|
||||||
|
return data.join(",");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A property has changed, and we want to make adjustments to other things
|
* A property has changed, and we want to make adjustments to other things
|
||||||
* based on that
|
* based on that
|
||||||
|
Loading…
Reference in New Issue
Block a user