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()};
$(window).resize(function (evt) {
$.each(winWh, function (type, val) {
window.addEventListener('resize', (evt) => {
Object.entries(winWh).forEach(([type, val]) => {
const curval = $(window)[type]();
this.workarea[0]['scroll' + (type === 'width' ? 'Left' : 'Top')] -= (curval - val) / 2;
winWh[type] = curval;