mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Etemplate: Fix some selectAccount bugs when multiple=true
This commit is contained in:
parent
a19e97df63
commit
39b630d36e
@ -619,7 +619,9 @@ var et2_link_entry = /** @class */ (function (_super) {
|
||||
select: function (event, item) {
|
||||
event.data = self;
|
||||
// Correct changed value from server
|
||||
item.item.value = item.item.value.trim();
|
||||
if (item.item.value) {
|
||||
item.item.value = ("" + item.item.value).trim();
|
||||
}
|
||||
self.select(event, item);
|
||||
return false;
|
||||
},
|
||||
|
@ -804,7 +804,10 @@ export class et2_link_entry extends et2_inputWidget
|
||||
{
|
||||
event.data = self;
|
||||
// Correct changed value from server
|
||||
item.item.value = item.item.value.trim();
|
||||
if(item.item.value)
|
||||
{
|
||||
item.item.value = (""+item.item.value).trim();
|
||||
}
|
||||
self.select(event,item);
|
||||
return false;
|
||||
},
|
||||
|
@ -326,10 +326,10 @@ var et2_selectAccount = /** @class */ (function (_super) {
|
||||
// Add to list
|
||||
ids.push(id);
|
||||
// Make sure option is there
|
||||
if (!widget.options.multiple && jQuery('input[id$="_opt_' + id + '"]', widget.multiOptions).length == 0) {
|
||||
if (widget.options.multiple && jQuery('input[id$="_opt_' + id + '"]', widget.multiOptions).length == 0) {
|
||||
widget._appendMultiOption(id, jQuery('label', this).text());
|
||||
}
|
||||
else if (widget.options.multiple && jQuery('option[value="' + id + '"]', widget.node).length == 0) {
|
||||
else if (!widget.options.multiple && jQuery('option[value="' + id + '"]', widget.node).length == 0) {
|
||||
widget._appendOptionElement(id, jQuery('label', this).text());
|
||||
}
|
||||
});
|
||||
@ -395,7 +395,7 @@ var et2_selectAccount = /** @class */ (function (_super) {
|
||||
self._appendOptionElement(selected.item.value, selected.item.label);
|
||||
}
|
||||
self.set_value(selected.item.value);
|
||||
if (self.dialog) {
|
||||
if (self.dialog && self.dialog.div) {
|
||||
self.dialog.div.dialog("close");
|
||||
}
|
||||
// Fire change event
|
||||
|
@ -405,11 +405,11 @@ export class et2_selectAccount extends et2_selectbox
|
||||
ids.push(id);
|
||||
|
||||
// Make sure option is there
|
||||
if(!widget.options.multiple && jQuery('input[id$="_opt_'+id+'"]',widget.multiOptions).length == 0)
|
||||
if(widget.options.multiple && jQuery('input[id$="_opt_'+id+'"]',widget.multiOptions).length == 0)
|
||||
{
|
||||
widget._appendMultiOption(id,jQuery('label',this).text());
|
||||
}
|
||||
else if (widget.options.multiple && jQuery('option[value="'+id+'"]',widget.node).length == 0)
|
||||
else if (!widget.options.multiple && jQuery('option[value="'+id+'"]',widget.node).length == 0)
|
||||
{
|
||||
widget._appendOptionElement(id,jQuery('label',this).text());
|
||||
}
|
||||
@ -495,7 +495,7 @@ export class et2_selectAccount extends et2_selectbox
|
||||
self._appendOptionElement(selected.item.value, selected.item.label);
|
||||
}
|
||||
self.set_value(selected.item.value);
|
||||
if(self.dialog)
|
||||
if(self.dialog && self.dialog.div)
|
||||
{
|
||||
self.dialog.div.dialog("close");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user