fix javascript error when calling CRM view a second time, thought no idea why this.et2 is not correctly initialised / jQuery.proxy in et2_core_common.js line 248 looses its context

This commit is contained in:
Ralf Becker 2014-03-10 17:42:58 +00:00
parent 68cf208ada
commit bb8608d694

View File

@ -85,13 +85,12 @@ app.classes.addressbook = AppJS.extend(
*/
view_actions: function(_action)
{
// no idea why this.et2 is sometimes not initialised
if (!this.et2 && typeof etemplate2 == 'object')
// no idea why this.et2 is sometimes not initialised correctly
// if (!(this.et2 && this.et2 instanceof et2_container) && typeof etemplate2 != 'undefined')
{
var template = etemplate2.getByApplication('addressbook.view')[0];
var template = etemplate2.getByTemplate('addressbook.view')[0];
this.et2 = template.widgetContainer;
}
var template = this.et2._inst;
var id = this.et2.getArrayMgr('content').data.id;
switch(_action.id)
@ -107,7 +106,7 @@ app.classes.addressbook = AppJS.extend(
this.egw.open(null, 'addressbook', 'list', null, '_self', 'addressbook');
break;
//default:
template.submit(_action.id);
this.et2._inst.template.submit(_action.id);
break;
}
},