[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 16 04:39:47 UTC 2020


 loleaflet/src/layer/AnnotationManager.js    |   12 ++++++++++++
 loleaflet/src/layer/tile/TileLayer.js       |    6 ++++++
 loleaflet/src/layer/tile/WriterTileLayer.js |    4 ++++
 3 files changed, 22 insertions(+)

New commits:
commit b3d481979beb62a393d86e8a3fcf2eacf468837b
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue Sep 15 10:09:35 2020 +0530
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 16 06:39:27 2020 +0200

    leaflet: annotation: new option added to remove thread
    
    Change-Id: Ib1578af2e2b53d801b74c1d94be789f7a6bce84c
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102782
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 7580884a8..3c1198c7a 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -699,6 +699,18 @@ L.AnnotationManager = L.Class.extend({
 		this._map.focus();
 	},
 
+	removeThread: function (id) {
+		var comment = {
+			Id: {
+				type: 'string',
+				value: id
+			}
+		};
+		this._map.sendUnoCommand('.uno:DeleteCommentThread', comment);
+		this.unselect();
+		this._map.focus();
+	},
+
 	_onRedlineAccept: function(e) {
 		var command = {
 			AcceptTrackedChange: {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 760620a1a..0a5cd72b7 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -251,6 +251,12 @@ L.TileLayer = L.GridLayer.extend({
 						that.onAnnotationRemove.call(that, options.$trigger.get(0).annotation._data.id);
 					}
 				},
+				removeThread: {
+					name: _('Remove Thread'),
+					callback: function (key, options) {
+						that.onAnnotationRemoveThread.call(that, options.$trigger.get(0).annotation._data.id);
+					}
+				},
 				resolve: this._docType !== 'text' ? undefined : {
 					name: _('Resolve'),
 					callback: function (key, options) {
diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js
index 53a15bea6..f32ea37ab 100644
--- a/loleaflet/src/layer/tile/WriterTileLayer.js
+++ b/loleaflet/src/layer/tile/WriterTileLayer.js
@@ -62,6 +62,10 @@ L.WriterTileLayer = L.TileLayer.extend({
 		this._annotations.remove(id);
 	},
 
+	onAnnotationRemoveThread: function (id) {
+		this._annotations.removeThread(id);
+	},
+
 	onAnnotationReply: function (annotation) {
 		this._annotations.reply(annotation);
 	},


More information about the Libreoffice-commits mailing list