From 0cda97d7ac9fdea8ab74f346203c4cec3913348f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 28 Jun 2017 12:09:21 +0200 Subject: [PATCH] Fix mail preview pane orientation feature according to new preferences --- mail/inc/class.mail_ui.inc.php | 20 ++++++++++++-------- mail/js/app.js | 7 ++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index dac8e7fe72..0e8c2bb9b6 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -589,16 +589,20 @@ class mail_ui self::callWizard($e->getMessage().($e->details?', '.$e->details:''),(isset($this->mail_bo)?false:true), 'error',false); //return false; } - // Check preview pane is enabled, then show splitter - preference used to be '1', now 'hide' - if ($this->mail_bo->mailPreferences['previewPane'] == '1' || $this->mail_bo->mailPreferences['previewPane'] == 'hide') + switch ($this->mail_bo->mailPreferences['previewPane']) { - $etpl->setElementAttribute('splitter', 'template', 'mail.index.nosplitter'); + case "1"://preference used to be '1', now 'hide' + case "hide": + $etpl->setElementAttribute('splitter', 'template', 'mail.index.nosplitter'); + break; + case "vertical": + $etpl->setElementAttribute('mailSplitter', 'orientation', 'v'); + break; + case "expand": + case "fixed": + $etpl->setElementAttribute('mailSplitter', 'orientation', 'h'); + break; } - elseif ($this->mail_bo->mailPreferences['splitterOrientation']) - { - $etpl->setElementAttribute('mailSplitter', 'orientation', $this->mail_bo->mailPreferences['splitterOrientation']); - } - return $etpl->exec('mail.mail_ui.index',$content,$sel_options,$readonlys,$preserv); } diff --git a/mail/js/app.js b/mail/js/app.js index 4d249b0c80..6841211283 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -167,7 +167,8 @@ app.classes.mail = AppJS.extend( }); var nm = this.et2.getWidgetById(this.nm_index); this.mail_isMainWindow = true; - this.mail_disablePreviewArea(this.egw.preference('previewPane', 'mail') !== 'fixed'); + var previewPane = this.egw.preference('previewPane', 'mail'); + this.mail_disablePreviewArea(previewPane !== 'fixed' && previewPane !== 'vertical'); //Get initial folder status this.mail_refreshFolderStatus(undefined,undefined,false); @@ -917,7 +918,7 @@ app.classes.mail = AppJS.extend( $preview_iframe.css ('top', $preview_iframe.position().top - offset + 10); }, 50); }; - + var previewPane = this.egw.preference('previewPane', 'mail'); // Show / hide 'Select something' in preview var blank = this.et2.getWidgetById('blank'); if(blank) @@ -929,7 +930,7 @@ app.classes.mail = AppJS.extend( // If there is content to show recalculate the size set_prev_iframe_top(); } - else if (this.egw.preference('previewPane', 'mail') == 'fixed') + else if (previewPane == 'fixed' || previewPane == 'vertical') { if(blank) {