Merge pull request #356 from ONLYOFFICE/bugfix/selection-area

Web: Files: Selection-area: fixed tile selection
This commit is contained in:
Alexey Safronov 2024-04-17 17:47:45 +04:00 committed by GitHub
commit 62a1c4e57d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3962,11 +3962,21 @@ class FilesStore {
const tileGap = isDesktopView ? 16 : 14;
const minTileWidth = 216 + tileGap;
const body = document.getElementById("section");
const tileContainer = document.getElementById("tileContainer");
const sectionPadding =
body?.offsetWidth - tileContainer?.clientWidth - tileGap + 1;
const elem = document.getElementsByClassName("section-wrapper-content")[0];
let containerWidth = 0;
if (elem) {
const elemPadding = window
.getComputedStyle(elem)
?.getPropertyValue("padding");
containerWidth =
elem?.clientWidth -
elemPadding.split("px")[1] -
elemPadding.split("px")[3];
}
const sectionPadding = body?.offsetWidth - containerWidth - tileGap + 1;
const sectionWidth = body ? body.offsetWidth - sectionPadding : 0;
return Math.floor(sectionWidth / minTileWidth);