mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-17 05:23:13 +01:00
Make sure the opener window is still there before asking about its widgets.
-Fix mail compose save as draft throws an error if the mail tab is closed while saving.
This commit is contained in:
parent
db8ed755f9
commit
1289d23df9
@ -3210,7 +3210,8 @@ app.classes.mail = AppJS.extend(
|
|||||||
{
|
{
|
||||||
var content = this.et2.getArrayMgr('content');
|
var content = this.et2.getArrayMgr('content');
|
||||||
var lastDrafted = this.et2.getWidgetById('lastDrafted');
|
var lastDrafted = this.et2.getWidgetById('lastDrafted');
|
||||||
var folderTree = opener.etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('nm[foldertree]');
|
var folderTree = typeof opener.etemplate2.getByApplication('mail')[0] !='undefined'?
|
||||||
|
opener.etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('nm[foldertree]'): null;
|
||||||
var activeFolder = folderTree?folderTree.getSelectedNode():null;
|
var activeFolder = folderTree?folderTree.getSelectedNode():null;
|
||||||
if (content)
|
if (content)
|
||||||
{
|
{
|
||||||
@ -3218,7 +3219,9 @@ app.classes.mail = AppJS.extend(
|
|||||||
content.data.lastDrafted = _responseData.draftedId;
|
content.data.lastDrafted = _responseData.draftedId;
|
||||||
this.et2.setArrayMgr('content', content);
|
this.et2.setArrayMgr('content', content);
|
||||||
lastDrafted.set_value(_responseData.draftedId);
|
lastDrafted.set_value(_responseData.draftedId);
|
||||||
if (typeof activeFolder.id !='undefined'&& activeFolder && _responseData.draftfolder == activeFolder.id)
|
if (folderTree && activeFolder)
|
||||||
|
{
|
||||||
|
if (typeof activeFolder.id !='undefined' && _responseData.draftfolder == activeFolder.id)
|
||||||
{
|
{
|
||||||
if (prevDraftedId)
|
if (prevDraftedId)
|
||||||
{
|
{
|
||||||
@ -3226,6 +3229,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
}
|
}
|
||||||
this.egw.refresh(_responseData.message,'mail',_responseData.draftedId);
|
this.egw.refresh(_responseData.message,'mail',_responseData.draftedId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
switch (_action)
|
switch (_action)
|
||||||
{
|
{
|
||||||
case 'button[saveAsDraftAndPrint]':
|
case 'button[saveAsDraftAndPrint]':
|
||||||
|
Loading…
Reference in New Issue
Block a user