fix resize

master
JFH 2021-01-01 11:36:21 +01:00
parent 528c69edbb
commit 7cae5b3ea1
1 changed files with 2 additions and 2 deletions

View File

@ -812,8 +812,8 @@ class Editor {
}); });
const winWh = {width: $(window).width(), height: $(window).height()}; const winWh = {width: $(window).width(), height: $(window).height()};
$(window).resize(function (evt) { window.addEventListener('resize', (evt) => {
$.each(winWh, function (type, val) { Object.entries(winWh).forEach(([type, val]) => {
const curval = $(window)[type](); const curval = $(window)[type]();
this.workarea[0]['scroll' + (type === 'width' ? 'Left' : 'Top')] -= (curval - val) / 2; this.workarea[0]['scroll' + (type === 'width' ? 'Left' : 'Top')] -= (curval - val) / 2;
winWh[type] = curval; winWh[type] = curval;