Only try to unbind if there's a value. If there isn't a value (new entry), handler wasn't bound, and trying causes an error.

Fixes blank popup after save.
This commit is contained in:
Nathan Gray 2014-01-13 15:03:15 +00:00
parent e94b62bd5e
commit 51d802ec78

View File

@ -173,8 +173,11 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
* Destroys all
*/
destroy: function() {
// Unbind
$j(window).off('.' +this.options.value.app + this.options.value.id);
// Unbind, if bound
if(this.options.value && !this.options.value.id)
{
$j(window).off('.' +this.options.value.app + this.options.value.id);
}
// Free the widgets
for(var i = 0; i < this.columns.length; i++)