mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
Common cleaning of r/o select value
This commit is contained in:
parent
8081f6abef
commit
650d76bd5c
@ -89,13 +89,30 @@ li {
|
||||
|
||||
set_value(value)
|
||||
{
|
||||
if(typeof value == "string")
|
||||
{
|
||||
value = value.split(",");
|
||||
}
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
set value(new_value)
|
||||
{
|
||||
// Split anything that is still a CSV
|
||||
if(typeof new_value == "string" && new_value.indexOf(",") > 0)
|
||||
{
|
||||
new_value = new_value.split(",");
|
||||
}
|
||||
// Wrap any single value into an array for consistent rendering
|
||||
if(typeof new_value == "string" || typeof new_value == "number")
|
||||
{
|
||||
new_value = ["" + new_value];
|
||||
}
|
||||
|
||||
super.value = new_value;
|
||||
}
|
||||
|
||||
get value()
|
||||
{
|
||||
return super.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the select options
|
||||
*
|
||||
@ -183,14 +200,6 @@ export class Et2SelectAccountReadonly extends Et2SelectReadonly
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof new_value == "string" && new_value.indexOf(",") > 0)
|
||||
{
|
||||
new_value = new_value.split(",");
|
||||
}
|
||||
if(typeof new_value == "string" || typeof new_value == "number")
|
||||
{
|
||||
new_value = ["" + new_value];
|
||||
}
|
||||
for(let id of new_value)
|
||||
{
|
||||
let account_name = null;
|
||||
|
Loading…
Reference in New Issue
Block a user