From 59af024cd4ed7d9ef653f66137e3444921422716 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Mon, 14 Sep 2020 12:57:54 +0530 Subject: [PATCH] leaflet: annotation: new option added to resolve thread Change-Id: Iba14345c782a6e28003845d238debe2935c54be6 --- loleaflet/src/layer/AnnotationManager.js | 10 ++++++++++ loleaflet/src/layer/tile/TileLayer.js | 6 ++++++ loleaflet/src/layer/tile/WriterTileLayer.js | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index c898b176f..5b3ba541f 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -657,6 +657,16 @@ L.AnnotationManager = L.AnnotationManagerBase.extend({ this._map.sendUnoCommand('.uno:ResolveComment', comment); }, + resolveThread: function (annotation) { + var comment = { + Id: { + type: 'string', + value: annotation._data.id + } + }; + this._map.sendUnoCommand('.uno:ResolveCommentThread', comment); + }, + updateResolvedState: function (annotation) { var threadIndexFirst = this.getRootIndexOf(annotation._data.id); if (this._items[threadIndexFirst]._data.resolved !== annotation._data.resolved) { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 6a76f3c07..35849e28f 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -256,6 +256,12 @@ L.TileLayer = L.GridLayer.extend({ callback: function (key, options) { that.onAnnotationResolve.call(that, options.$trigger.get(0).annotation); } + }, + resolveThread: this._docType !== 'text' ? undefined : { + name: _('Resolve Thread'), + callback: function (key, options) { + that.onAnnotationResolveThread.call(that, options.$trigger.get(0).annotation); + } } }, events: { diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js index 5a120fdb0..223236bd4 100644 --- a/loleaflet/src/layer/tile/WriterTileLayer.js +++ b/loleaflet/src/layer/tile/WriterTileLayer.js @@ -82,6 +82,10 @@ L.WriterTileLayer = L.CanvasTileLayer.extend({ this._annotations.resolve(annotation); }, + onAnnotationResolveThread: function (annotation) { + this._annotations.resolveThread(annotation); + }, + onChangeAccept: function(id) { this._annotations.acceptChange(id); },