From 459ba3d93c80a09d0dcf2b61d54da93283197626 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 11 Sep 2020 13:11:52 -0600 Subject: [PATCH] * Etemplate: Fix historylog did not render until you resize the window --- api/js/etemplate/et2_widget_historylog.js | 16 +++++----------- api/js/etemplate/et2_widget_historylog.ts | 14 ++++---------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/api/js/etemplate/et2_widget_historylog.js b/api/js/etemplate/et2_widget_historylog.js index 6e52d35d8f..9390c46fda 100644 --- a/api/js/etemplate/et2_widget_historylog.js +++ b/api/js/etemplate/et2_widget_historylog.js @@ -167,13 +167,12 @@ var et2_historylog = /** @class */ (function (_super) { jQuery(this.dataview.getHeaderContainerNode(i)).text(et2_historylog.columns[i].caption); } // Register a resize callback - var self = this; jQuery(window).on('resize.' + this.options.value.app + this.options.value.id, function () { - if (self && typeof self.dynheight != 'undefined') - self.dynheight.update(function (_w, _h) { - self.dataview.resize(_w, _h); - }); - }); + if (this && typeof this.dynheight != 'undefined') + this.dynheight.update(function (_w, _h) { + this.dataview.resize(_w, _h); + }.bind(this)); + }.bind(this)); }; /** * Destroys all @@ -389,11 +388,6 @@ var et2_historylog = /** @class */ (function (_super) { // Pass the fetch call to the API this.egw().dataFetch(this.getInstanceManager().etemplate_exec_id, _queriedRange, this._filters, this.id, function (_response) { _callback.call(this, _response); - // This seems to prevent unwanted scrollbars - historylog.div.hide(); - window.setTimeout(function () { - historylog.div.show(); - }.bind(historylog), 100); }, _context, []); }; // Needed by interface diff --git a/api/js/etemplate/et2_widget_historylog.ts b/api/js/etemplate/et2_widget_historylog.ts index 67db95d072..3ce6d911f1 100644 --- a/api/js/etemplate/et2_widget_historylog.ts +++ b/api/js/etemplate/et2_widget_historylog.ts @@ -252,13 +252,12 @@ export class et2_historylog extends et2_valueWidget implements et2_IDataProvider } // Register a resize callback - const self = this; jQuery(window).on('resize.' +this.options.value.app + this.options.value.id, function() { - if (self && typeof self.dynheight != 'undefined') self.dynheight.update(function(_w, _h) { - self.dataview.resize(_w, _h); - }); - }); + if (this && typeof this.dynheight != 'undefined') this.dynheight.update(function(_w, _h) { + this.dataview.resize(_w, _h); + }.bind(this)); + }.bind(this)); } /** @@ -540,11 +539,6 @@ export class et2_historylog extends et2_valueWidget implements et2_IDataProvider this.id, function(_response) { _callback.call(this,_response); - // This seems to prevent unwanted scrollbars - historylog.div.hide(); - window.setTimeout(function() { - historylog.div.show(); - }.bind(historylog),100); }, _context, []