Fix mail preview pane orientation feature according to new preferences

This commit is contained in:
Hadi Nategh 2017-06-28 12:09:21 +02:00
parent 0fdc96d875
commit 0cda97d7ac
2 changed files with 16 additions and 11 deletions

View File

@ -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);
}

View File

@ -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)
{