* Etemplate: Fix historylog did not render until you resize the window

This commit is contained in:
nathangray 2020-09-11 13:11:52 -06:00
parent 638da52fa9
commit 459ba3d93c
2 changed files with 9 additions and 21 deletions

View File

@ -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

View File

@ -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,
[]