mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Make taglist-state update its own options when country code changes
Fixes bug where options were not properly set if they had to be fetched from server.
This commit is contained in:
parent
46a3818e92
commit
934d309856
@ -485,8 +485,6 @@ var AddressbookApp = /** @class */ (function (_super) {
|
||||
var region = this.et2.getWidgetById(selectbox.name.replace('countrycode', 'region'));
|
||||
if (region) {
|
||||
region.set_country_code(selectbox.value);
|
||||
region.options.select_options = {};
|
||||
region.transformAttributes(region.options);
|
||||
}
|
||||
};
|
||||
/**
|
||||
|
@ -577,8 +577,6 @@ class AddressbookApp extends EgwApp
|
||||
if (region)
|
||||
{
|
||||
region.set_country_code(selectbox.value);
|
||||
region.options.select_options = {};
|
||||
region.transformAttributes(region.options);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1255,8 +1255,14 @@ var et2_taglist_state = /** @class */ (function (_super) {
|
||||
};
|
||||
et2_taglist_state.prototype.set_country_code = function (_country_code) {
|
||||
var country_code = _country_code || '';
|
||||
var old_code = this.options.country_code;
|
||||
this.country_code = country_code;
|
||||
this.options.country_code = country_code;
|
||||
// Reload if needed
|
||||
if (this.options.country_code !== old_code && this.isInTree()) {
|
||||
var sel_options = et2_widget_selectbox_1.et2_selectbox.find_select_options(this, {}, this.options);
|
||||
this.set_select_options(sel_options);
|
||||
}
|
||||
};
|
||||
et2_taglist_state._attributes = {
|
||||
"minChars": {
|
||||
|
@ -1478,8 +1478,16 @@ class et2_taglist_state extends et2_taglist
|
||||
set_country_code(_country_code)
|
||||
{
|
||||
let country_code = _country_code || '';
|
||||
let old_code = this.options.country_code;
|
||||
this.country_code = country_code;
|
||||
this.options.country_code = country_code;
|
||||
|
||||
// Reload if needed
|
||||
if(this.options.country_code !== old_code && this.isInTree())
|
||||
{
|
||||
var sel_options = et2_selectbox.find_select_options(this, {}, this.options);
|
||||
this.set_select_options(sel_options);
|
||||
}
|
||||
}
|
||||
}
|
||||
et2_register_widget(et2_taglist_state, ["taglist-state"]);
|
||||
|
Loading…
Reference in New Issue
Block a user