From 51d802ec78f4a7a7395b5ecdd1bb66aab71a2000 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 13 Jan 2014 15:03:15 +0000 Subject: [PATCH] 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. --- etemplate/js/et2_widget_historylog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_historylog.js b/etemplate/js/et2_widget_historylog.js index ab3592cf34..ba6aa7c6ef 100644 --- a/etemplate/js/et2_widget_historylog.js +++ b/etemplate/js/et2_widget_historylog.js @@ -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++)