mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fix entity list resizing
This commit is contained in:
parent
60c538309a
commit
de7f4a4a4d
2 changed files with 6 additions and 16 deletions
|
@ -1219,7 +1219,7 @@ function loaded() {
|
|||
refreshSortOrder();
|
||||
refreshEntities();
|
||||
|
||||
window.onresize = updateColumnWidths;
|
||||
window.addEventListener("resize", updateColumnWidths);
|
||||
});
|
||||
|
||||
augmentSpinButtons();
|
||||
|
|
|
@ -72,11 +72,6 @@ ListView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onScroll: function() {
|
||||
var that = this.listView;
|
||||
that.scroll();
|
||||
},
|
||||
|
||||
scroll: function() {
|
||||
let scrollTop = this.elTableScroll.scrollTop;
|
||||
let scrollHeight = this.getScrollHeight();
|
||||
|
@ -244,18 +239,13 @@ ListView.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onResize: function() {
|
||||
var that = this.listView;
|
||||
that.resize();
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
if (!this.elTableBody || !this.elTableScroll) {
|
||||
debugPrint("ListView.resize - no valid table body or table scroll element");
|
||||
return;
|
||||
}
|
||||
|
||||
let prevScrollTop = this.elTableScroll.scrollTop;
|
||||
let prevScrollTop = this.elTableScroll.scrollTop;
|
||||
|
||||
// take up available window space
|
||||
this.elTableScroll.style.height = window.innerHeight - WINDOW_NONVARIABLE_HEIGHT;
|
||||
|
@ -305,10 +295,10 @@ ListView.prototype = {
|
|||
this.elTableBody.appendChild(this.elBottomBuffer);
|
||||
this.elBottomBuffer.setAttribute("height", 0);
|
||||
|
||||
this.elTableScroll.listView = this;
|
||||
this.elTableScroll.onscroll = this.onScroll;
|
||||
window.listView = this;
|
||||
window.onresize = this.onResize;
|
||||
this.onScroll = this.scroll.bind(this);
|
||||
this.elTableScroll.addEventListener("scroll", this.onScroll);
|
||||
this.onResize = this.resize.bind(this);
|
||||
window.addEventListener("resize", this.onResize);
|
||||
|
||||
// initialize all row elements
|
||||
this.resize();
|
||||
|
|
Loading…
Reference in a new issue