leaflet: annotation: new option added to resolve thread

Change-Id: Iba14345c782a6e28003845d238debe2935c54be6
This commit is contained in:
Pranam Lashkari 2020-09-14 12:57:54 +05:30 committed by Pranam Lashkari
parent 995f454c32
commit 59af024cd4
3 changed files with 20 additions and 0 deletions

View file

@ -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) {

View file

@ -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: {

View file

@ -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);
},