mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
fix double load of UI in compose after adding attachments caused by errors in mail app.js compose_resize handler
This commit is contained in:
parent
b01ac97b7e
commit
b8f2902e80
@ -255,7 +255,7 @@ app.classes.mail = AppJS.extend(
|
||||
}
|
||||
else
|
||||
{
|
||||
this.compose_fieldExpander();
|
||||
that.compose_fieldExpander();
|
||||
}
|
||||
});
|
||||
|
||||
@ -3907,49 +3907,54 @@ app.classes.mail = AppJS.extend(
|
||||
// very limited resources and slow proccessor.
|
||||
if (egwIsMobile()) return;
|
||||
|
||||
var bodyH = egw_getWindowInnerHeight();
|
||||
var textArea = this.et2.getWidgetById('mail_plaintext');
|
||||
var $headerSec = jQuery('.mailComposeHeaderSection');
|
||||
var attachments = this.et2.getWidgetById('attachments');
|
||||
var content = this.et2.getArrayMgr('content').data;
|
||||
try {
|
||||
var bodyH = egw_getWindowInnerHeight();
|
||||
var textArea = this.et2.getWidgetById('mail_plaintext');
|
||||
var $headerSec = jQuery('.mailComposeHeaderSection');
|
||||
var attachments = this.et2.getWidgetById('attachments');
|
||||
var content = this.et2.getArrayMgr('content').data;
|
||||
|
||||
// @var arrbitary int represents px
|
||||
// Visible height of attachment progress
|
||||
var prgV_H = 150;
|
||||
// @var arrbitary int represents px
|
||||
// Visible height of attachment progress
|
||||
var prgV_H = 150;
|
||||
|
||||
// @var arrbitary int represents px
|
||||
// Visible height of attchements list
|
||||
var attchV_H = 68;
|
||||
// @var arrbitary int represents px
|
||||
// Visible height of attchements list
|
||||
var attchV_H = 68;
|
||||
|
||||
if (typeof textArea != 'undefined' && textArea != null)
|
||||
{
|
||||
if (textArea.getParent().disabled)
|
||||
if (typeof textArea != 'undefined' && textArea != null)
|
||||
{
|
||||
textArea = this.et2.getWidgetById('mail_htmltext');
|
||||
}
|
||||
// Tolerate values base on plain text or html, in order to calculate freespaces
|
||||
var textAreaDelta = textArea.id == "mail_htmltext"?20:40;
|
||||
if (textArea.getParent().disabled)
|
||||
{
|
||||
textArea = this.et2.getWidgetById('mail_htmltext');
|
||||
}
|
||||
// Tolerate values base on plain text or html, in order to calculate freespaces
|
||||
var textAreaDelta = textArea.id == "mail_htmltext"?20:40;
|
||||
|
||||
// while attachments are in progress take progress visiblity into account
|
||||
// otherwise the attachment progress is finished and consider attachments list
|
||||
var delta = (attachments.table.find('li').length>0 && attachments.table.height() > 0)? prgV_H: (content.attachments? attchV_H: textAreaDelta);
|
||||
// while attachments are in progress take progress visiblity into account
|
||||
// otherwise the attachment progress is finished and consider attachments list
|
||||
var delta = (attachments.table.find('li').length>0 && attachments.table.height() > 0)? prgV_H: (content.attachments? attchV_H: textAreaDelta);
|
||||
|
||||
var bodySize = (bodyH - Math.round($headerSec.height() + $headerSec.offset().top) - delta);
|
||||
var bodySize = (bodyH - Math.round($headerSec.height() + $headerSec.offset().top) - delta);
|
||||
|
||||
if (textArea.id != "mail_htmltext")
|
||||
{
|
||||
textArea.getParent().set_height(bodySize);
|
||||
textArea.set_height(bodySize);
|
||||
}
|
||||
else if (typeof textArea != 'undefined' && textArea.id == 'mail_htmltext')
|
||||
{
|
||||
textArea.ckeditor.resize('100%', bodySize);
|
||||
}
|
||||
else
|
||||
{
|
||||
textArea.set_height(bodySize - 90);
|
||||
if (textArea.id != "mail_htmltext")
|
||||
{
|
||||
textArea.getParent().set_height(bodySize);
|
||||
textArea.set_height(bodySize);
|
||||
}
|
||||
else if (typeof textArea != 'undefined' && textArea.id == 'mail_htmltext')
|
||||
{
|
||||
textArea.ckeditor.resize('100%', bodySize);
|
||||
}
|
||||
else
|
||||
{
|
||||
textArea.set_height(bodySize - 90);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
// ignore errors causing compose to load twice
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user