Trying to completely get rid of jiggling montage layout (montage.js)

pull/4032/head
IgorA100 2024-05-22 23:03:26 +03:00 committed by GitHub
parent 915b706c6f
commit 5fdac67540
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 6 deletions

View File

@ -840,6 +840,9 @@ function initPage() {
const observer = new ResizeObserver((objResizes) => { const observer = new ResizeObserver((objResizes) => {
const blockContent = document.getElementById('content'); const blockContent = document.getElementById('content');
const currentScrollBbarExists = blockContent.scrollHeight > blockContent.clientHeight; const currentScrollBbarExists = blockContent.scrollHeight > blockContent.clientHeight;
if (scrollBbarExists === null) {
scrollBbarExists = currentScrollBbarExists;
}
if (currentScrollBbarExists != scrollBbarExists) { if (currentScrollBbarExists != scrollBbarExists) {
scrollBbarExists = currentScrollBbarExists; scrollBbarExists = currentScrollBbarExists;
return; return;
@ -900,12 +903,12 @@ function addEvents(grid, id) {
//let g = (id !== undefined ? 'grid' + id + ' ' : ''); //let g = (id !== undefined ? 'grid' + id + ' ' : '');
grid.on('change', function(event, items) { grid.on('change', function(event, items) {
/* Occurs when widgets change their position/size due to constrain or direct changes */ /* Occurs when widgets change their position/size due to constrain or direct changes */
items.forEach(function(item) { //items.forEach(function(item) {
const currentMonitorId = stringToNumber(item.id); //We received the ID of the monitor whose size was changed // const currentMonitorId = stringToNumber(item.id); //We received the ID of the monitor whose size was changed
//setTriggerChangedMonitors(currentMonitorId); // //setTriggerChangedMonitors(currentMonitorId);
//monitorsSetScale(currentMonitorId); // //monitorsSetScale(currentMonitorId);
setTriggerChangedMonitors(currentMonitorId); // setTriggerChangedMonitors(currentMonitorId);
}); //});
elementResize(); elementResize();
}) })