fix javascript error "no method indexOf of undefined"

This commit is contained in:
Ralf Becker 2014-10-06 09:57:50 +00:00
parent d3cde1efb4
commit 1b9865bbbf

View File

@ -674,20 +674,18 @@ app.classes.mail = AppJS.extend(
var remembervalue = '';
for(var i = 0; i < content.length; i++)
{
if (typeof content[i] != 'string' || !content[i]) continue;
// if there is no @ in string, its most likely that we have a comma in the personal name part of the emailaddress
if (content[i] != 'undefined' && content[i])
if (content[i].indexOf('@')< 0)
{
if (content[i].indexOf('@')< 0)
{
remembervalue = content[i];
}
else
{
var value = remembervalue+(remembervalue?',':'')+content[i];
var email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true, contact_plus:true},widget);
email.loadingFinished();
remembervalue = '';
}
remembervalue = content[i];
}
else
{
var value = remembervalue+(remembervalue?',':'')+content[i];
var email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true, contact_plus:true},widget);
email.loadingFinished();
remembervalue = '';
}
}
}
@ -3229,7 +3227,7 @@ app.classes.mail = AppJS.extend(
{
var content = this.et2.getArrayMgr('content');
var lastDrafted = this.et2.getWidgetById('lastDrafted');
var folderTree = typeof opener.etemplate2.getByApplication('mail')[0] !='undefined'?
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;
if (content)
@ -3248,7 +3246,7 @@ app.classes.mail = AppJS.extend(
}
this.egw.refresh(_responseData.message,'mail',_responseData.draftedId);
}
}
}
switch (_action)
{
case 'button[saveAsDraftAndPrint]':
@ -3600,23 +3598,23 @@ app.classes.mail = AppJS.extend(
var folder = mailbox[1] || 'INBOX', acc_id = mailbox[0];
this.egw.open_link('mail.mail_acl.edit&mailbox='+ jQuery.base64Encode(folder)+'&acc_id='+acc_id, '_blank', '640x480');
},
/**
* Submit new selected folder back to server in order to read its acl's rights
*/
acl_folderChange: function ()
{
var mailbox = this.et2.getWidgetById('mailbox');
if (mailbox)
{
if (mailbox.taglist.getValue().length > 0)
{
this.et2._inst.submit();
}
}
}
},
/**
* Edit a mail account
*