summaryrefslogtreecommitdiffstats
path: root/loleaflet
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-11-03 13:25:36 +0100
committerSzymon Kłos <eszkadev@gmail.com>2021-11-03 15:50:11 +0100
commit55c9ecac1e66f2215c70887400bef87f565b0ed4 (patch)
tree6ebced6a05fe95ea78aa1b242efc795ed90a4a9c /loleaflet
parentdisable quarantine by default even if its section is missing from loolwsd.xml (diff)
downloadonline-55c9ecac1e66f2215c70887400bef87f565b0ed4.tar.gz
online-55c9ecac1e66f2215c70887400bef87f565b0ed4.zip
Don't waste space for comment section
Use trick to set 1px width for comment section so it doesn't reserve space which can be used for document itself. Thanks to that we don't see grey area on the right side when zoom level is big enough so document is shown in a full width. Position correctly HTML elements for comments so they are still visible. Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: Iccae9c834e05bd1afc5c43424b03d95335923a53
Diffstat (limited to 'loleaflet')
-rw-r--r--loleaflet/src/layer/tile/CommentListSection.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/loleaflet/src/layer/tile/CommentListSection.ts b/loleaflet/src/layer/tile/CommentListSection.ts
index a23a76d42e..4fdefc6203 100644
--- a/loleaflet/src/layer/tile/CommentListSection.ts
+++ b/loleaflet/src/layer/tile/CommentListSection.ts
@@ -76,7 +76,7 @@ class CommentSection {
this.sectionProperties.marginY = 10 * app.dpiScale;
this.sectionProperties.offset = 5 * app.dpiScale;
this.sectionProperties.layoutTimer = null;
- this.sectionProperties.width = Math.round(300 * app.dpiScale); // Configurable variable.
+ this.sectionProperties.width = Math.round(1 * app.dpiScale); // Configurable variable.
this.sectionProperties.scrollAnnotation = null; // For impress, when 1 or more comments exist.
}
@@ -211,8 +211,6 @@ class CommentSection {
|| this.sectionProperties.docLayer._docType === 'spreadsheet'
|| this.sectionProperties.commentList.length === 0)
return;
-
- this.size[0] = 1 * app.dpiScale;
}
public setExpanded() {
@@ -226,8 +224,6 @@ class CommentSection {
|| this.sectionProperties.docLayer._docType === 'spreadsheet'
|| this.sectionProperties.commentList.length === 0)
return;
-
- this.size[0] = 300 * app.dpiScale;
}
public hideAllComments () {
@@ -1483,8 +1479,12 @@ class CommentSection {
var yOrigin = null;
var selectedIndex = null;
var x = topRight[0];
- if (this.containerObject.getDocumentAnchorSection().size[0] > app.file.size.pixels[0]) {
+ var commentWidth = 300;
+ var availableSpace = this.containerObject.getDocumentAnchorSection().size[0] - app.file.size.pixels[0];
+ if (availableSpace > commentWidth * 2) {
x = topRight[0] - Math.round((this.containerObject.getDocumentAnchorSection().size[0] - app.file.size.pixels[0]) * 0.5);
+ } else if (!this.isCollapsed) {
+ x -= commentWidth;
}
if (this.isCollapsed)