From 4354a02fbd8e451d57ec51b6ef4e854012f35150 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 11 Oct 2013 09:28:33 +0000 Subject: [PATCH] display: control attachmentdiv and displayareadiv class by code, to hide attachmentarea, when no attachments are present --- mail/inc/class.mail_compose.inc.php | 8 ++++---- mail/inc/class.mail_ui.inc.php | 8 +++++--- mail/templates/default/app.css | 28 +++++++++++++++++++++------- mail/templates/default/display.xet | 7 ++----- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 550c0b4fda..c863e50924 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1151,21 +1151,21 @@ class mail_compose // if no filemanager -> no vfsFileSelector if (!$GLOBALS['egw_info']['user']['apps']['filemanager']) { - $content['vfsNotAvailable'] = "mail-index_quotaDisplayNone"; + $content['vfsNotAvailable'] = "mail_DisplayNone"; } // if no infolog -> no save as infolog if (!$GLOBALS['egw_info']['user']['apps']['infolog']) { - $content['noInfologAvailable'] = "mail-index_quotaDisplayNone"; + $content['noInfologAvailable'] = "mail_DisplayNone"; } // if no tracker -> no save as tracker if (!$GLOBALS['egw_info']['user']['apps']['tracker']) { - $content['noTrackerAvailable'] = "mail-index_quotaDisplayNone"; + $content['noTrackerAvailable'] = "mail_DisplayNone"; } if (!$GLOBALS['egw_info']['user']['apps']['infolog'] && !$GLOBALS['egw_info']['user']['apps']['tracker']) { - $content['noSaveAsAvailable'] = "mail-index_quotaDisplayNone"; + $content['noSaveAsAvailable'] = "mail_DisplayNone"; } // composeID to detect if we have changes to certain content $preserv['composeID'] = $content['composeID'] = $this->composeID; diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index fdebf1e17d..096de617b2 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -251,8 +251,8 @@ class mail_ui $content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = ""; } else { $content[self::$nm_index]['quota'] = $sel_options[self::$nm_index]['quota'] = lang("Quota not provided by server"); - $content[self::$nm_index]['quotaclass'] = $sel_options[self::$nm_index]['quotaclass'] = "mail-index_quotaDisplayNone"; - $content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "mail-index_quotaDisplayNone"; + $content[self::$nm_index]['quotaclass'] = $sel_options[self::$nm_index]['quotaclass'] = "mail_DisplayNone"; + $content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "mail_DisplayNone"; } $sel_options[self::$nm_index]['foldertree'] = $this->getFolderTree(false); @@ -1706,6 +1706,8 @@ unset($query['actions']); //_debug_array($attachments); $content['mail_displayattachments'] = $attachmentHTMLBlock; $content['mail_id']=$rowID; + $content['mailDisplayContainerClass']=(count($attachments)?"mailDisplayContainer mailDisplayContainerFixedHeight":"mailDisplayContainer mailDisplayContainerFullHeight"); + $content['mailDisplayAttachmentsClass']=(count($attachments)?"mailDisplayAttachments":"mail_DisplayNone"); //_debug_array($content); $readonlys = $preserv = $content; $etpl->exec('mail.mail_ui.displayMessage',$content,$sel_options,$readonlys,$preserv,2); @@ -2432,7 +2434,7 @@ blockquote[type=cite] { color: blue; } -
+
'; $EndBody = '
'; diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index ad90ee0c6f..155b637a23 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -293,6 +293,9 @@ pre { width:200px !important; z-index:99; } +.mail_DisplayNone { + display: none !important; +} .mail-index_quotaDisplayNone { display: none !important; } @@ -384,8 +387,8 @@ input[type=button] { padding: 0px; height: 16px !important; } -#mail-display_toolbar { - padding: 0px; +#mail-compose_toolbar > button { + padding: .2em .4em; } #mail-display_toolbar > button > span { padding: .2em .4em; @@ -421,7 +424,7 @@ input[type=button] { } #mail-index_previewAttachmentArea { background-color:#efefdf; - max-height: 10%; + max-height: 3em; max-width: 50%; position: absolute; overflow:scroll; @@ -453,15 +456,26 @@ input[type=button] { overflow-y: auto; border: 1px solid silver; top: 120px; - bottom: 100px; +} +.mailDisplayContainerFixedHeight { + bottom: 123px; +} +.mailDisplayContainerFullHeight { + bottom: .1em; +} +.mailDisplayBody { + height:100%; + width:100%; + background-color:white; + padding:0px; + margin:0px; } .mailDisplayAttachments { background-color:#efefdf; - max-height: 10%; + height: 121px; position: fixed; - bottom: 26px; + bottom: .1em; border: 1px solid red; - border-bottom: 0px; opacity: 1; -moz-opacity:1: filter: Alpha(opacity=100); diff --git a/mail/templates/default/display.xet b/mail/templates/default/display.xet index 3ed1e1946a..6d81b129c6 100644 --- a/mail/templates/default/display.xet +++ b/mail/templates/default/display.xet @@ -33,15 +33,12 @@ - - - - + - +