From ad2d331c866d9d220334121e111187b30b39c76a Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 21 May 2015 14:27:15 +0000 Subject: [PATCH] Do not reinitiate the history log if it is already initiated --- etemplate/js/et2_widget_historylog.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_widget_historylog.js b/etemplate/js/et2_widget_historylog.js index 8c126d98ae..e45adfc448 100644 --- a/etemplate/js/et2_widget_historylog.js +++ b/etemplate/js/et2_widget_historylog.js @@ -105,7 +105,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable], }); }); - e.data.history.finishInit(); + if (typeof e.data.history.dataview == "undefined") e.data.history.finishInit(); e.data.history.dynheight.update(function(_w, _h) { e.data.history.dataview.resize(_w, _h); }); @@ -113,7 +113,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable], tabs.tabData[i].flagDiv.bind("click.history",{"history": this, div: tabs.tabData[i].flagDiv}, handler); // Display if history tab is selected - if(i == tabs.get_active_tab()) + if(i == tabs.get_active_tab() && typeof this.dataview == 'undefined') { tabs.tabData[i].flagDiv.trigger("click.history"); } @@ -179,7 +179,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable], // Register a resize callback var self = this; $j(window).on('resize.' +this.options.value.app + this.options.value.id, function() { - self.dynheight.update(function(_w, _h) { + if (self && typeof self.dynheight != 'undefined') self.dynheight.update(function(_w, _h) { self.dataview.resize(_w, _h); }); });