mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Fix resource (contact, resource, etc.) label sometimes not found
This commit is contained in:
parent
695a72e3e8
commit
358df21fd2
@ -832,7 +832,7 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR
|
||||
var min_width = jQuery('.ms-sel-item',this.div ).first().outerWidth() || this.div.children().first().width();
|
||||
|
||||
// Not ready yet
|
||||
if(min_width === null) return;
|
||||
if(min_width === null || !this.taglist) return;
|
||||
|
||||
min_width += (this.options.multiple === 'toggle' ? jQuery('.toggle',this.div).outerWidth() : 0);
|
||||
min_width += this.taglist.trigger ? this.taglist.trigger.outerWidth(true) : 0;
|
||||
|
@ -90,6 +90,36 @@ var et2_calendar_owner = (function(){ "use strict"; return et2_taglist_email.ext
|
||||
{
|
||||
if(this.taglist == null) return null;
|
||||
return this.taglist.getValue();
|
||||
},
|
||||
|
||||
/**
|
||||
* Override parent to handle our special additional data types (c#,r#,etc.) when they
|
||||
* are not available client side.
|
||||
*
|
||||
* @param {string|string[]} _value array of selected owners, which can be a number,
|
||||
* or a number prefixed with one character indicating the resource type.
|
||||
*/
|
||||
set_value: function(_value)
|
||||
{
|
||||
this._super.apply(this, arguments);
|
||||
|
||||
// If parent didn't find a label, label will be the same as ID so we
|
||||
// can find them that way
|
||||
for(var i = 0; i < this.options.value.length; i++)
|
||||
{
|
||||
var value = this.options.value[i];
|
||||
if(value.id == value.label)
|
||||
{
|
||||
// Proper label was not fount by parent - ask directly
|
||||
egw.json('calendar_owner_etemplate_widget::ajax_owner',value.id,function(data) {value.label = data;}, this).sendRequest();
|
||||
}
|
||||
}
|
||||
|
||||
if(this.taglist)
|
||||
{
|
||||
this.taglist.clear(true);
|
||||
this.taglist.addToSelection(this.options.value,true);
|
||||
}
|
||||
}
|
||||
});}).call(this);
|
||||
et2_register_widget(et2_calendar_owner, ["calendar-owner"]);
|
Loading…
Reference in New Issue
Block a user