From 96109e0f264d7f15fd468a8e9960f4daa5e8752f Mon Sep 17 00:00:00 2001 From: ralf Date: Sat, 18 Jun 2022 15:06:50 +0200 Subject: [PATCH] Several account or contact edit fixes - fix no groups were selected (as they have numeric values) - fix size of country and state selection - WIP adding flags to select-country - WIP fixing selecting a country set country_code for state selection --- addressbook/js/app.ts | 7 ++-- addressbook/templates/default/app.css | 1 - addressbook/templates/default/edit.xet | 44 ++++++++++------------- addressbook/templates/pixelegg/app.css | 2 -- addressbook/templates/pixelegg/app.less | 1 - api/js/etemplate/Et2Select/Et2Select.ts | 48 +++++++++++++++++++++++-- 6 files changed, 66 insertions(+), 37 deletions(-) diff --git a/addressbook/js/app.ts b/addressbook/js/app.ts index 065fa325c7..f78036c6ff 100644 --- a/addressbook/js/app.ts +++ b/addressbook/js/app.ts @@ -739,8 +739,7 @@ class AddressbookApp extends EgwApp show_custom_country(selectbox) { if(!selectbox) return; - var custom_field_name = selectbox.id.replace("countrycode", "countryname"); - var custom_field = document.getElementById(custom_field_name); + const custom_field = this.et2.getWidgetById(selectbox.id.replace("countrycode", "countryname")); let display = "inline"; if(custom_field && selectbox.value == "-custom-") { display = "inline"; @@ -750,8 +749,6 @@ class AddressbookApp extends EgwApp if((selectbox.value == "" || selectbox.value == null) && custom_field.value != "") { selectbox.value = "-custom-"; - // Chosen needs this to update - jQuery(selectbox).trigger("liszt:updated"); display = "inline"; } @@ -765,7 +762,7 @@ class AddressbookApp extends EgwApp custom_field.attributeStyleMap.set("display", display); } - var region = this.et2.getWidgetById(selectbox.name.replace('countrycode', 'region')); + var region = this.et2.getWidgetById(selectbox.id.replace('countrycode', 'region')); if(region) { region.set_country_code(selectbox.value); diff --git a/addressbook/templates/default/app.css b/addressbook/templates/default/app.css index 0f611df33b..9c691fa4d9 100644 --- a/addressbook/templates/default/app.css +++ b/addressbook/templates/default/app.css @@ -132,7 +132,6 @@ select#addressbook-index_col_filter\[tid\] { #addressbook-index_nm .chzn-drop {width:auto;} #addressbook-edit_adr_one_region, #addressbook-edit_adr_two_region { - width: 130px; vertical-align: middle; margin-left: 1px; } diff --git a/addressbook/templates/default/edit.xet b/addressbook/templates/default/edit.xet index 307e2ebb4e..f5a9fdb274 100644 --- a/addressbook/templates/default/edit.xet +++ b/addressbook/templates/default/edit.xet @@ -91,9 +91,8 @@ options="tel_fax,♥"/> -