Calc Comment: Tablet view improvements.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ib6fae1b675ac293044e3a829edeaf51648becd73
This commit is contained in:
Gökay Şatır 2021-06-04 13:19:47 +03:00 committed by Gökay ŞATIR
parent 63eb3c29bb
commit f0d7cb40ef
3 changed files with 10 additions and 2 deletions

View file

@ -246,6 +246,8 @@ L.CalcTileLayer = L.CanvasTileLayer.extend({
this.refreshViewData(undefined, true /* compatDataSrcOnly */, false /* sheetGeometryChanged */);
this._replayPrintTwipsMsgAllViews('cellviewcursor');
this._replayPrintTwipsMsgAllViews('textviewselection');
// Hide previous tab's shown comment (if any).
app.sectionContainer.getSectionWithName(L.CSections.CommentList.name).hideAllComments();
}
},

View file

@ -114,7 +114,7 @@ class CommentSection {
}
}
private hideAllComments () {
public hideAllComments () {
for (var i: number = 0; i < this.sectionProperties.commentList.length; i++) {
this.sectionProperties.commentList[i].hide();
}
@ -227,7 +227,7 @@ class CommentSection {
var dialog = vex.dialog.open({
message: '',
input: [
'<textarea name="comment" class="loleaflet-annotation-textarea" required>' + commentData.text + '</textarea>'
'<textarea name="comment" class="loleaflet-annotation-textarea" required>' + (commentData.text ? commentData.text: '') + '</textarea>'
].join(''),
buttons: [
$.extend({}, vex.dialog.buttons.YES, { text: _('Save') }),
@ -440,7 +440,11 @@ class CommentSection {
if (this.sectionProperties.selectedComment && $(this.sectionProperties.selectedComment.sectionProperties.container).hasClass('annotation-active'))
$(this.sectionProperties.selectedComment.sectionProperties.container).removeClass('annotation-active');
if (this.sectionProperties.docLayer._docType === 'spreadsheet')
this.sectionProperties.selectedComment.hide();
this.sectionProperties.selectedComment = null;
this.update();
}
}

View file

@ -791,6 +791,7 @@ class Comment {
// We will use this event as click event on touch devices, until we remove Hammer.js (then this code will be removed from here).
// Control.ColumnHeader.js file is not affected by this situation, because map element (so Hammer.js) doesn't cover headers.
if ((<any>window).mode.isMobile() || (<any>window).mode.isTablet()) {
this.onMouseEnter();
this.onClick(point, e);
}
}
@ -807,6 +808,7 @@ class Comment {
var containerWidth: number = this.sectionProperties.container.getBoundingClientRect().width;
var ratio: number = (app.tile.size.pixels[0] / app.tile.size.twips[0]);
this.size = [Math.round((this.sectionProperties.data.cellPos[2]) * ratio + containerWidth), Math.round((this.sectionProperties.data.cellPos[3]) * ratio)];
this.sectionProperties.commentListSection.selectById(this.sectionProperties.data.id);
this.show();
}
}