fix taglist-account failed to dynamic load all accounts not already cached client-side

(everything worked before, if all accounts are cached client-side!)
This commit is contained in:
Ralf Becker 2019-04-01 12:35:17 +02:00
parent a3aaa9c2ba
commit 833936e499

View File

@ -1058,15 +1058,20 @@ var et2_taglist_account = (function(){ "use strict"; return et2_taglist.extend(
{ {
values[i] = { values[i] = {
id: v, id: v,
label: label label: label || '#'+v
}; };
} }
else if (!this.deferred_loading) // call set_value again, after result has arrived from server else
{ {
delete this.options.value;
this.deferred_loading++; this.deferred_loading++;
this.egw().link_title('api-accounts', v, function(label) { this.egw().link_title('api-accounts', v, jQuery.proxy(function(idx, id, label) {
this.deferred_loading--; this.deferred_loading--;
if (label) values[idx] = {
id: id,
label: label || '#'+id
};
if (!this.deferred_loading)
{ {
// Seems the magic suggest can not deal with broken taglist value // Seems the magic suggest can not deal with broken taglist value
// like selected value with no label set and maxSelection set. This // like selected value with no label set and maxSelection set. This
@ -1078,7 +1083,7 @@ var et2_taglist_account = (function(){ "use strict"; return et2_taglist.extend(
this.set_value(values); this.set_value(values);
this.taglist.setMaxSelection(this.options.maxSelection); this.taglist.setMaxSelection(this.options.maxSelection);
} }
}, this); }, this, i, v));
} }
} }
} }