diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index 8b98ca423d..1c8cbfdb44 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -144,7 +144,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2InvokerMixin(Et2WidgetWithS // Only do this on firstUpdated() otherwise it is impossible to clear the field const valueArray = Array.isArray(this.value) ? this.value : (!this.value ? [] : this.value.toString().split(',')); // value not in options --> use empty_label, if exists, or first option otherwise - if(!this.multiple && this.select_options.length > 0 && this.select_options.filter((option) => valueArray.find(val => val == option.value)).length === 0) + if(!this.multiple && this.select_options.length > 0 && !this.onchange && this.select_options.filter((option) => valueArray.find(val => val == option.value)).length === 0) { this.value = this.empty_label ? "" : "" + this.select_options[0]?.value; // ""+ to cast value of 0 to "0", to not replace with "" } diff --git a/mail/js/app.js b/mail/js/app.js index 5728355af5..e83790bdaf 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -18,7 +18,13 @@ import {et2_button} from "../../api/js/etemplate/et2_widget_button"; import {egw_getObjectManager} from '../../api/js/egw_action/egw_action.js'; import {egwIsMobile, egwSetBit} from "../../api/js/egw_action/egw_action_common.js"; import {EGW_AO_FLAG_DEFAULT_FOCUS} from "../../api/js/egw_action/egw_action_constants.js"; -import {egw_keycode_translation_function, egw_keycode_makeValid, egw_keyHandler} from "../../api/js/egw_action/egw_keymanager.js"; +import { + egw_keycode_translation_function, + egw_keycode_makeValid, + egw_keyHandler +} from "../../api/js/egw_action/egw_keymanager.js"; +import {Et2UrlEmailReadonly} from "../../api/js/etemplate/Et2Url/Et2UrlEmailReadonly"; +import {Et2SelectEmail} from "../../api/js/etemplate/Et2Select/Et2SelectEmail"; /* required dependency, commented out because no module, but egw:uses is no longer parsed */ @@ -28,7 +34,7 @@ import {egw_keycode_translation_function, egw_keycode_makeValid, egw_keyHandler} * @augments AppJS */ app.classes.mail = AppJS.extend( -{ + { appname: 'mail', /** * modified attribute in mail app to test new entries get added on top of list @@ -1059,18 +1065,22 @@ app.classes.mail = AppJS.extend( { var value = remembervalue+(remembervalue?',':'')+content[i]; var url_email_options = { - id:widget.id+'_'+i, - value:value, - readonly:true, - contact_plus:true, - full_email:typeof field['full_email'] !='undefined'?field['full_email']:true + id: widget.id + '_' + i, + value: value, + readonly: true, + contact_plus: true, + full_email: typeof field['full_email'] != 'undefined' ? field['full_email'] : true }; - var email = et2_createWidget('url-email',url_email_options,widget); + var email = et2_createWidget('url-email', url_email_options, widget); email.loadingFinished(); remembervalue = ''; } } } + else if (widget instanceof Et2SelectEmail) + { + widget.value = content; + } else { widget.set_value({content: content}); @@ -1270,10 +1280,10 @@ app.classes.mail = AppJS.extend( // TO addresses have the first one split out, not all together // list of keys: var expand_content = [ - {build_children: true, data_one: 'fromaddress', data: 'additionalfromaddress', widget: 'additionalFromAddress', line: 'mailPreviewHeadersFrom'}, - {build_children: true, data_one: 'toaddress', data: 'additionaltoaddress', widget: 'additionalToAddress', line: 'mailPreviewHeadersTo'}, - {build_children: true, data: 'ccaddress', widget: 'additionalCCAddress', line: 'mailPreviewHeadersCC'}, - {build_children: false, data: 'attachmentsBlock', widget:'previewAttachmentArea', line: 'mailPreviewHeadersAttachments'} + {build_children: false, data_one: 'fromaddress', data: 'additionalfromaddress', widget: 'fromAddress', line: 'mailPreviewHeadersFrom'}, + {build_children: false, data_one: 'toaddress', data: 'additionaltoaddress', widget: 'toAddress', line: 'mailPreviewHeadersTo'}, + {build_children: false, data: 'ccaddress', widget: 'CCAddress', line: 'mailPreviewHeadersCC'}, + {build_children: false, data: 'attachmentsBlock', widget: 'previewAttachmentArea', line: 'mailPreviewHeadersAttachments'} ]; // Undock the preview before running expandOnClick, because we diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index 3416e7c330..4a9f0105f0 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -447,15 +447,17 @@ div.mail-compose_fileselector { width: 100%; } #mail-index_mailPreview { - overflow: hidden; - position: relative; - background-color: white; + overflow: hidden; + position: relative; + background-color: white; } -div#mail-index_mailPreview > div { - padding-left: 8px !important; + +div#mail-index_mailPreview > div, div#mail-index_mailPreview > et2-hbox { + padding-left: 8px !important; } -#mail-index_mailPreview .et2_email>span{ - display: inline; + +#mail-index_mailPreview .et2_email > span { + display: inline; } .maildisplayAllAdresses { max-height: 245px !important; @@ -598,37 +600,46 @@ div.mail-display > div:first-parent > div.first-parent overflow: hidden; right: 8px; } + .mailDisplayHeaderSection { - position: absolute; - top: 12px; + position: absolute; + top: 12px; } + div.mailDisplayHeaders > div:first-parent { - overflow: hidden; + overflow: hidden; } -div.mailDisplayHeaders > span:first-child, div.mailPreviewHeaders > span:first-child { - width: 7em; - display: inline-block; + +div.mailDisplayHeaders > span:first-child, div.mailPreviewHeaders > span:first-child { + width: 7em; + display: inline-block; } + +div.mailDisplayHeaders et2-select-email, div.mailPreviewHeaders et2-select-email { + display: inline-block; +} + #mail-display_toolbar { - display: inline-flex; + display: inline-flex; } + div.mailComposeHeaders > span:first-child { - width: 8em; + width: 8em; } -div.mailDisplayHeaders div.mail_extraEmails -{ - display: inline-block; - max-height: 1.3em; - max-width: 50%; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: top; + +div.mailDisplayHeaders div.mail_extraEmails { + display: inline-block; + max-height: 1.3em; + max-width: 50%; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: top; } -div.mailDisplayHeaders div.mail_extraEmails.visible -{ - position: fixed; - left: 7em; + +div.mailDisplayHeaders div.mail_extraEmails.visible { + position: fixed; + left: 7em; display: block; max-height: 8em; min-width: 30em; diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index ef2627d722..fd560c6c02 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -11,38 +11,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -52,100 +50,126 @@ - - - - - - - - - - - - - - - - - - - - - - -