only bind session/request destroy handler, if we have an etemplate_exec_id. Not the case for pure client-side call like from et2_dialog

This commit is contained in:
Ralf Becker 2014-01-17 17:51:17 +00:00
parent b31befc23b
commit 0c2d8f87b9

View File

@ -198,8 +198,13 @@ etemplate2.prototype._createArrayManagers = function(_data)
/** /**
* Bind our unload handler to notify server that eT session/request no longer needed * Bind our unload handler to notify server that eT session/request no longer needed
*
* We only bind, if we have an etemplate_exec_id: not the case for pure client-side
* calls, eg. via et2_dialog.
*/ */
etemplate2.prototype.bind_unload = function() etemplate2.prototype.bind_unload = function()
{
if (this.etemplate_exec_id)
{ {
this.destroy_session = jQuery.proxy(function(ev) this.destroy_session = jQuery.proxy(function(ev)
{ {
@ -212,6 +217,7 @@ etemplate2.prototype.bind_unload = function()
{ {
window.onbeforeunload = this.destroy_session; window.onbeforeunload = this.destroy_session;
} }
}
}; };
/** /**