fix behavior after merge.

This commit is contained in:
Thijs Wenker 2018-11-17 01:20:36 +01:00
parent 7b3d2bed15
commit ba790ae470
2 changed files with 7 additions and 6 deletions

View file

@ -396,8 +396,8 @@ function loaded() {
elEntityTableHeaderRow = document.querySelectorAll("#entity-table thead th");
entityList = new ListView(elEntityTableBody, elEntityTableScroll, elEntityTableHeaderRow,
createRow, updateRow, clearRow, preRefresh, postRefresh, WINDOW_NONVARIABLE_HEIGHT);
entityList = new ListView(elEntityTableBody, elEntityTableScroll, elEntityTableHeaderRow, createRow, updateRow,
clearRow, preRefresh, postRefresh, preRefresh, WINDOW_NONVARIABLE_HEIGHT);
entityListContextMenu = new EntityListContextMenu();
@ -448,7 +448,7 @@ function loaded() {
function preRefresh() {
// move the rename input to the body
if (elRenameInput) {
if (!isRenameFieldBeingMoved && elRenameInput) {
isRenameFieldBeingMoved = true;
document.body.appendChild(elRenameInput);
// keep the focus

View file

@ -13,8 +13,8 @@ debugPrint = function (message) {
console.log(message);
};
function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunction,
updateRowFunction, clearRowFunction, preRefreshFunction, postRefreshFunction, WINDOW_NONVARIABLE_HEIGHT) {
function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunction, updateRowFunction, clearRowFunction,
preRefreshFunction, postRefreshFunction, preResizeFunction, WINDOW_NONVARIABLE_HEIGHT) {
this.elTableBody = elTableBody;
this.elTableScroll = elTableScroll;
this.elTableHeaderRow = elTableHeaderRow;
@ -27,6 +27,7 @@ function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunctio
this.clearRowFunction = clearRowFunction;
this.preRefreshFunction = preRefreshFunction;
this.postRefreshFunction = postRefreshFunction;
this.preResizeFunction = preResizeFunction;
// the list of row elements created in the table up to max viewable height plus SCROLL_ROWS rows for scrolling buffer
this.elRows = [];
@ -248,7 +249,7 @@ ListView.prototype = {
debugPrint("ListView.resize - no valid table body or table scroll element");
return;
}
this.preResizeFunction();
let prevScrollTop = this.elTableScroll.scrollTop;
// take up available window space